I am trying to use jquery in CEWP. In my html script, I am providing jquery reference which is available in SiteAssets library. I am using jquery library for some fancy slider.
When I save html script the web part editor it includes reference of jquery as attribute of HTML tag. First time it works fine with no issue. Whenever I edit the html script of web part, SharePoint includes the reference of jquery again and it keeps on increasing with every edit of html script. Because of which effect of jquery gets wrong.
I am not able to figure the issue. Is there some limitation of using jquery with CEWP? Is there any work around of this?
My prefered method of attack is to create the jquery script as a JS file and store it in the site assets library. Then using a content editor web part on the desired page where the script should be, I put the URL of the JS file in the link to content box.
Then in SharePoint Designer, I can make updates to the JS file as needed and refresh the SharePoint page to see the effect of my changes.
You could also apply it to your master page and it will be available on every page.