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

In SharePoint 2013 I tried:

ExecuteOrDelayUntilScriptLoaded(function () { alert("Hi"); }, 'SP.js');

But SP.js is not registering for anonymous users.

share|improve this question

SP.js is a file that is only loaded when called. Mostly. Otherwise if users have access to certain ribbon commands which loads it.

Try calling SP.js in your application and see if that works.

share|improve this answer
Thanks Dandroid for the replay and i tested it when i edit the page I can see that SP.JS is registering. But my main concern is for anonymous user so Are there any way to do it for anonymous user? – Hitman Jan 25 '13 at 12:53
@Hitman Register the SP.js file in your masterpage. That way it is loaded on each page using that masterpage and then it doesn't if the user is anonymous or not. – Daniel Ziga Jan 25 '13 at 14:41

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.