I have two jquery script. when one script works, the other one does not function and vice versa. Intially, I thought it is because both scripts had same function name etc. I changed the variable name and everything. It still doesn't work. Both of the scripts uses promoted links but different promoted links not the same one. Attached is the CEWP file. When I delete the first line of the script in a staging environment, it works, however, it doesn't on the production environment?
1 Answer
You are using more than JQuery references
that lead to ش conflict issue and the script will not work properly.
- Try to remove
jQuery-latest-min.js
ref orJquery.11.2.min,js
- Add the
JQuery references
before other scripts. - Replace
JQuery(decoument)
with$(decoument)
- Use Script editor web part instead of Content editor
-
When I remove the jquery-latest-min.js (the first line of code from the second image of the script) , it works fine in the staging envrionment. But when I remove it in the production sharepoint environment, the tabs don't show up (the script is meant for tabs). Is there a reason for this? When I remove that chunk of code, both scripts work fine but only in staging environment. I am not sure why @Mohamed El-Qassas– user10Commented Nov 7, 2018 at 2:37
-
you should don't add two jquery references! this will cause conflict, so when you remove the first line it will work! so make sure you only use one reference in the production, check if you are using another ref in master page or another script web part, Commented Nov 9, 2018 at 16:11