1

Recently i am migrated from SP2010 to SP2013 and i am trying to use the on demand js in pop ups. While doing that, i am facing an issue in getting an alternative for the following

var url = SP.Utilities.Utility.getLayoutsPageUrl(Path);

Can anyone help in getting the equivalent method/property in the sharepoint 2013 in Javascript for opening popup?.

3

The method remains the same in 2013, your problem could be that you do not request SP.js before calling the method.

Try this:

SP.SOD.executeFunc('sp.js', 'SP.ClientContext', sharePointReady);

function sharePointReady(){
    var url = SP.Utilities.Utility.getLayoutsPageUrl(window.location.href);
    /* DO YOU STUFF */
}
  • Sorry its not working.. getting "ReferenceError: SPUtility is not defined" – Sivakumar Nagasamy Mar 17 '14 at 14:54
  • Sorry, missed that you where talking javascript – Robert Lindgren Mar 17 '14 at 14:57
  • Updated my answer – Robert Lindgren Mar 17 '14 at 15:01
  • You are awesome dude.. i was nearby the answer and by the time you nailed it.. – Sivakumar Nagasamy Mar 17 '14 at 15:18
  • 1
    My tip is to call one method like above, then let that method call your functions – Robert Lindgren Mar 17 '14 at 15:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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