0
var siteUrl='sites/mysite';

function wait(){
    var clientContext = new SP.ClientContext(siteUrl);
    ....more code....
}
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', wait());

ERROR: Object does not support this action

I am writing this JavaScript on a custom list EditForm in SP 2013.

What's wrong?

3

The code SP.SOD.executeFunc('sp.js', 'SP.ClientContext', wait()); will invoke method wait() to evaluate the parameter value.

To SP.SOD.executeFunc you should pass the function name as below

SP.SOD.executeFunc('sp.js', 'SP.ClientContext', wait);
| improve this answer | |
  • That modification gets me... Error: 'ClientContext' is undefined – Das Nov 7 '14 at 20:52
  • @Das it seems issue with the way you are referencing the JS files. Can you post how you have added the sp js file in master page? – Amal Hashim Nov 7 '14 at 21:49
  • I have not added sp.js to the master page. Perhaps that is the issue? When I arrived here, they did have the site rebranded. How/where would I add sp.js to the master page? Your guidance and feedback is appreciated!! – Das Nov 7 '14 at 23:10
  • @Das follow this article blog.qumsieh.ca/2013/10/30/… – Amal Hashim Nov 7 '14 at 23:18
  • Will try the above on Monday and report back. Thx! – Das Nov 8 '14 at 18: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.