Skip to content Skip to sidebar Skip to footer

Jquery Ie9-10: Unable To Get Property Replace Of Undefined Or Null Reference

I'm developing a page with the following libraries; jQuery (1.7.2) (older version because of a dependency issue, but have tried up to 1.9.1, doesn't fix issue). Backbone (1.1.0) l

Solution 1:

Turns out the issue wasn't something inherently wrong with IE, but rather I was trying to access an object which didn't entirely exist yet. The other browsers this was not an issue (perhaps their JS engines were just fast enough for it to be a non-issue), but I've now added checks to ensure all the relevant content has loaded before executing the problematic function and the issue seems to be gone. Thanks for the help, all.

Solution 2:

What kind of tool are you using for debugging? I have a solution for you for Chrome debug console 1. First go Find the jquery script file in the console, right click and select "Blackbox script" it is going to be ignored while debugging, only your files are going to be considered 2. Activate break on errors and a breakpoint is going to be triggered on the line of code where the exception is occurring Check JavaScript: Is there a way to get Chrome to break on all errors? and https://developer.chrome.com/devtools/docs/blackboxing

Solution 3:

Maybe I'm wrong here but is it possible that IE8-9 "string" is a reserved word? Maybe not. But the only time .replace would show that message is if you were not feeding it a string.

camelCase: function( string ) {
    if(!string){ 
         console.log("string is falsy", string);
         returnstring;
    }
    returnstring.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
},

Post a Comment for "Jquery Ie9-10: Unable To Get Property Replace Of Undefined Or Null Reference"