0

Using IE9 (9.0.8112.16421) I receive the following error in the debugger while running the script I'm working on:

"Unable to get value of the property 'toLowerCase': object is null or undefined"

in the following function:

function ExecuteOrDelayUntilScriptLoaded(func, depScriptFileName)
{ULSxSy:;
    depScriptFileName=depScriptFileName.toLowerCase();
    var eventName="sp.scriptloaded-"+depScriptFileName;
    return ExecuteOrDelayUntilEventNotified(func, eventName);
}

Any idea what is going on here?

4
  • How do you use ExecuteOrDelayUntilScriptLoaded? Or if this error appears when trying to use it with oob sharepont file (ExecuteOrDelayUntilScriptLoaded(function(){...}, "sp.js") for example)? Mar 12, 2012 at 20:00
  • Second scenario exactly. I'm just calling it in a $(document).ready(ExecuteOrDelayScriptLoaded(function(){...}, "sp.js")); call. The embedded function works fine when I add it to a click event for a dummy button. So I know there is no issue in that. Mar 13, 2012 at 0:09
  • Just to add some info. This was in a page I added tot he site pages gallery. When I added the code to my custom edit form the misbehaving method executed with no errors. From a practical perspective, it is moot, but from an understanding what went wrong perspective I am still trying to find an answer. Mar 13, 2012 at 17:55
  • I am now unable to duplicate the error at all. It might have been fixed via an IIS reset or the gremlins moved on to something else. I am debating closing the question as "too localized". Apr 4, 2012 at 20:00

1 Answer 1

2

Try this code:

$(document).ready(function(){

 ExecuteOrDelayUntilScriptLoaded(function(){...}, "sp.js");

});

The document.ready() expects a function delegate where you cannot pass arguments directly.

3
  • I will give this a try. But like I mentioned above, the exact code worked in the CustomEditForm.aspx I created. This also would not really explain the error as the error states it is a problem in depScriptFileName not having a toLower() function. Mar 14, 2012 at 12:11
  • Nope, did not resolve the problem. Mar 14, 2012 at 20:49
  • Vardhaman, I'm going to select your answer. As I stated above. I cannot even reproduce the problem now... Apr 14, 2012 at 0:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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