1

I'm getting a

jQuery undefined

error because my library isn't loading from CDN. On my html master page I've got this reference. I'm a little new to SharePoint branding and have seen lots of examples on the net with this. I anyone able to assist me here with what I'm doing wrong.

enter image description here

3 Answers 3

1

If you try to add an normal script tag with a src="" .. does it work then? That would in that case be as good as the other. You don't have to use ScriptLink for all scripts if you not are using the engine in SharePoint if you're not loading it through the SOD. Explained here: By Hugh Wood

1
  • Thanks. I've sorted now by removing actual need of jQuery in master pages which I believe was not necessary from what i've read on the net. The jquery load happens on pages that require it. Jun 3, 2015 at 9:40
2

I am not sure from the screenshot if you referencing the jQuery file at the correct position. It may lead to not loading of the script. Please try adding a simple script with an alert, if the alert pops up then the position is correct.

For the reference error, I am never been able to get CDN working, you can manually store the Jquery file in site assets and refer it like below:

<script type="text/javascript" src="<SiteURL>/SiteAssets/scripts/jquery-1.8.1.min.js">
</script>

I always get it to work like this in SharePoint Online.

0

Try

<script src="//ajax.googleapis.com/ajax/libs/jQuery/1.11.12/jquery.min.js">
//<![CDATA[//]]>
</script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.