djq
djq

Reputation: 15288

IE not loading page with Javascript and Raphael

I'm testing out a website that runs fine on Firefox (Win/Mac), Chrome (Win/Mac) and Safari. I'm having difficulty with Internet Explorer unfortunately. I get the following error message:

SCRIPT65535: Unexpected call to method or property access. 
raphael-min.js, line 8 character 64961

I've taken a look at the debug output which looks like just takes me to a part of the Raphel library:

c=a.getScreenCTM()||a.createSVGMatrix()

I've searched for this error message online, but I don't understand what solution is relevant to this case as I've no idea what is causing the problem. I am also using the jQuery library. Are there any tests that I can do that can give me more information about the source of the problem?

Upvotes: 2

Views: 521

Answers (2)

4wk_
4wk_

Reputation: 2733

I just found how to patch this, in order to keep the compressed version of Raphael.

Replace (don't forget the coma):

c=a.getScreenCTM()||a.createSVGMatrix(),

By that (dont't forget the end space):

c;try{c=a.getScreenCTM()||a.createSVGMatrix()}catch(e){c=a.createSVGMatrix()};var 

Works fine ! :)


Means :

  1. c; : declaration of variable c, and stop the first instruction.
  2. try{c=a.getScreenCTM()||a.createSVGMatrix()}catch(e){c=a.createSVGMatrix()}; : our instruction, surrounded by a try/catch, to avoid IE error
  3. var + a space : (don't forget the space!) allow us to continue to declare variable

Upvotes: 5

inhan
inhan

Reputation: 7470

I found out that it's an issue with compression (of the js file). I had the exact same issue and I had been searching for a solution. Guess what? I tried it with the uncompressed Raphael file and voila! No more issues. Compressed file needs a tweak, it seems.

Upvotes: 3

Related Questions