1

I am using SP.SOD.executeOrDelayUntilScriptLoaded as follows

SP.SOD.executeOrDelayUntilScriptLoaded(NBSFeedbackEditInbox.FeedbackRemove.removemessage(itemid), "sp.js");

Yet I am getting an error object expected error. I read that it's something to do with the (itemid) but when I need to pass that into the method. Any ideas?

1

MSDN:

SP.SOD.executeOrDelayUntilScriptLoaded(func, depScriptFileName);

Parameters: func - The function to execute. Type: Function

depScriptFileName - The name of the file containing the function. Type: String

The func parameter is the function-object, not some JavaScript code. You can create parameterless function and call in it your NBSFeedbackEditInbox.FeedbackRemove.removemessage(itemid)

SP.SOD.executeOrDelayUntilScriptLoaded(someSimpleWrapper, "sp.js");
function someSimpleWrapper(){
  NBSFeedbackEditInbox.FeedbackRemove.removemessage(itemid);
}

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.