Haryono Sariputra
Haryono Sariputra

Reputation: 310

IE 11 showing error when i clicking with jquery function

IE so much confusing me with some errors like this,

SCRIPT1002: Syntax error
File: jquery-2.1.4.min.js, Line:2 Column 2538

The weird thing is , on firefox and chrome running well and no error. And some button with jquery click function is working.

I'm Using IE 11 Before this i'm using jquery-1.1.13.min.js and when i use jquery 2.0 it still running properly on firefox and chrome

I'm really new with cross browser so any info will helping me very much, thanks :)

Upvotes: 0

Views: 1813

Answers (2)

Nick Haex
Nick Haex

Reputation: 11

Mostly these errors are not problems of jQuery itself. The problem situates in code using jQuery or inserted into jQuery (callbacks or event functionalities). In my case I used $.ajax to load a remote page in a div element. In the page I loaded there where // comment tags in the javascript part. As IE is putting this content on one line, more code that as I wanted was commented and this created the error.

So if in our case us are using $.ajax maybe this can be an issue. Otherwise best thing to do is debugging the code that generates this error and look for code that is not supported by IE (the version you use). Look for functions passed trough to jQuery.

Upvotes: 1

Tim Smith
Tim Smith

Reputation: 682

For the record I had this error which only showed itself on IE when doing cross-browser testing of a big Javascript code change.

In my case the problem was a function definition which included what would be a default in any other language:

i.e. Function Foo(param1, param2, param3=false)

.. clearly this was a stupid bit of code .. but it took me a while to track down so this might help someone out there. Doesn't show up in Chrome, FF, or even Edge.

Upvotes: 1

Related Questions