Amit
Amit

Reputation: 31

why jquery not working in IE8 , but in chrome/firefox

I have a problem with my jQuery code in IE 8. I have a script that constructs some UI dynamically with div on load. This works fine in chrome and firefox, but in IE it does not load. It does not log anything when it comes to second line below.

AV.console.debug("start customer UI");
e = $("<div></div>").addClass("av-webassist-main").hide();
AV.console.debug("customerUI added main container");

It logs the first debug in console and nothing after that. The page stays blank. If I try to run the second line in console,

e = $("<div></div>").addClass("av-webassist-main").hide();

it throws error 'null' is null or not an object I am clueless how to debug this. I am using jquery-1.9.1.js.

Upvotes: 2

Views: 423

Answers (2)

Jurgen
Jurgen

Reputation: 410

Is jQuery loaded? Try this:

if (jQuery) {  
    alert('jQuery is loaded');
} else {
    alert('jQuery is not loaded');
}

What if you create the DIV in another way? Like

$(document.createElement('div'))

Does that change anything?

Upvotes: 0

j08691
j08691

Reputation: 207901

Remove or comment out your console.debug lines. IE chokes on them unless the console is open.

Upvotes: 4

Related Questions