C0D3
C0D3

Reputation: 6559

jquery (null is null or not an object) error on IE8

When I load jquery using:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

it works on IE9, firefox, chrome, safari but not IE8. I tried the developer/debugger tools but still don't understand why this is an issue.

This is the character code jquery supposedly has error on: 32039.
On that line there is such function:

G=function(a){
   var b=F.exec(a);
   b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));
   return b
}

Anyone came across this issue as well?

The site is http://www.kanersan.com

I am not calling jquery before it is loaded and I'm loading it inside the head tag.

Upvotes: 7

Views: 13296

Answers (3)

Rafferty
Rafferty

Reputation: 1017

Some things worth trying...

  • Remove type="text/javascript" like so: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

  • Make sure you reference jquery.min.js before your javascript code that uses jQuery.

Most probably, the above suggestions will not help, but since the problem sounds IE8 specific, I believe it's worth a try doing some trivial things that might solve the problem.

Upvotes: -3

FrontEnd Expert
FrontEnd Expert

Reputation: 5803

try to folow some steps:-

1.jQuery is not being loaded, this is not likely specific to IE8. Check the path on your jQuery include. statement. Or better yet,.. TRy to give direct path.

2.May be because of compatibility issue.. Try to give compatibility solutions.. Things worked in IE6, Firefox, and IE8 running in IE7 compatibility mode; but not in 'normal' IE8. My solution was to put this code in the header

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

As to why jquery isn't working in IE8 I'm unclear.

3.Try to load your jquery on window load.

4.Try to define your jquery file in top..

5.Very important point - try to check your html and jquery code.. IE is very sensetive for code.. so cross check your Html code ,... Is everything is fine..

6.Changing browser sercurity level to allow executing external javascript code.

7.Replicate javascript framwork..

May this will help You !!!!!!!!1

Upvotes: 3

Nenad
Nenad

Reputation: 3556

This is a bug in jQuery 1.7.1 when used with SyntaxHighlighter

http://bugs.jquery.com/ticket/10961

So you have to upgrade jQuery to 1.7.2 and everything will be working fine.

Upvotes: 5

Related Questions