SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using JavaScript Client object model to get rootWeb and check permissions of current user. So I have used ExecuteOrDelayUntilScriptLoaded in my MasterPage to wait for sp.js. The problem is when I go to some pages for example AllItems.aspx (click a document library) sp.js is not loaded and my funcition will not be fired. I tried to set onDemond for sp.js to false but I got many other "Undefinde or object is null" errors. is there any solution for that? do I need to set ondemond for all javascripts to false?

share|improve this question
up vote 0 down vote accepted

Execute javascript function LoadSodByKey('sp.js') on your page. It will load sp.js file with all its dependencies.

share|improve this answer
do I need to change AllItems.aspx? – user12955 Nov 14 '12 at 14:02
you can try to do it in the end of your master page – Dmitry Kozlov Nov 14 '12 at 14:10
Yes, thank you so much it works now. – user12955 Nov 14 '12 at 17:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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