Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

In SharePoint 2013 I tried:

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

But SP.js is not registering for anonymous users.

share|improve this question
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.