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

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?

share|improve this question
    
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)? –  Kai Mar 12 '12 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. –  Robert Kaucher Mar 13 '12 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. –  Robert Kaucher Mar 13 '12 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". –  Robert Kaucher Apr 4 '12 at 20:00
add comment

1 Answer

up vote 2 down vote accepted

Try this code:

$(document).ready(function(){

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

});

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

share|improve this answer
    
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. –  Robert Kaucher Mar 14 '12 at 12:11
    
Nope, did not resolve the problem. –  Robert Kaucher Mar 14 '12 at 20:49
    
Vardhaman, I'm going to select your answer. As I stated above. I cannot even reproduce the problem now... –  Robert Kaucher Apr 14 '12 at 0:23
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.