I have created two functional Units on my application page. One comes along in a separate script, the other is embedded via script editor web part.

The external script is called fiirst all the time an I am priming jQuery using SP.SOD.registerSod('jquery', 'cdn-path/to/jquery');. When the script in my script Editor web part gets hit, I use SP.SOD.executeFunc('jquery', callback); to assure jQuery is loaded and I can execute my callback.

This does not work, though. When I reach the second call to SP.SOD.executeFunc() jQuery is already loaded, the callback just does not get called. However if I prime the same jQuery script again using SP.SOD.registerSod('jquery2', path/to/same/jquerycdn) everything works. What am I missing? How can I use jQuery across the scripts?


1 Answer 1


SOD (Script on Demand) and the MDS feature (Minimal Download Strategy) are not the easiest.

Not answering your question:

Use the Chrome Extension SharePoint Editor once


to load jQuery with a UserCustomAction ScriptLink

That will load jQuery early on on every page in the SiteCollection

and save you some SOD & MDS headaches

  • Thank you for your engagement. I just don't get why the callback is not being called (please see question again, I added some Information). Can MDS be disabled?
    – bash.d
    Apr 26, 2017 at 10:28
  • Yes, MDS is a Site Collection feature. If you disable it and your callback works you know MDS is interfering (or better said: your SOD code is wrong) That is why using a ScriptLink to load jQuery always saves a whole lot of headaches Apr 26, 2017 at 10:41
  • MDS is disabled. Currently I can only change individual site features, nevertheless the Feature is disabled on the desired site. Do you have any other ideas?
    – bash.d
    Apr 26, 2017 at 10:47
  • Not for your callback issue, had too many headaches with it in the past. Load jQuery the easy/fastest/safest way with that Chrome Extensions, if you want to scope it to the Web : see johnliu.net/blog/2015/12/… Apr 26, 2017 at 11:38
  • Unfortunately I cannot use Chrome due to restrictions in the company. So I will use my Approach which is ugly but works. Thank you
    – bash.d
    Apr 26, 2017 at 12:30

Your Answer

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

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