MRchildNEO / svgweb

Automatically exported from code.google.com/p/svgweb
Other
0 stars 0 forks source link

jquery 1.6 in MSIE gives error #621

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
— What steps will reproduce the problem?
1. use jQuery 1.6 (or 1.6.1)
2. open page in MSIE 8

— What is the expected output? What do you see instead?
Javascript error happens:
... is undefined
file svg.js
line 56
string 90

— What version of the product are you using? On what operating system,
browser, and version of Flash?
svgweb-2011-02-03-Lurker-Above.zip
Windows XP
Internet Explorer 8.0.6001.18702
Flash 10.1.53.64

— Please provide any additional information below. Reduced test cases are
always appreciated!
I have changed the jQuery version to 1.5.2 — all works fine now!

Original issue reported on code.google.com by evpozdni...@gmail.com on 11 Jun 2011 at 9:11

GoogleCodeExporter commented 8 years ago
I ran into this problem too when trying to upgrade from jQuery 1.5 to 1.6.1 in 
my svgweb application.

The short solution:  
It was found that moving all non-svgweb script tags out of the <head> section 
of the page and putting them at the very bottom solved this problem.

Detailed explanation:
The error that was reported in the original post was thrown from line 2274 of 
svg-uncompressed.js.  This is where svgweb tries to get the value of the 
'onsvgload' attribute from the HTML body tag.  This was failing because the 
statement
    >> body = document.getElementsByTagName('body')[0]
was returning undefined.

Through a lot of debugging using Visual Studio, it became apparent that for 
some reason (the exact cause still is still unknown) Internet Explorer did not 
parse the HTML document fully when jQuery 1.6(.1) was used instead of jQuery 
1.5(.1|2).  This meant that when the empty script that svgweb adds to the end 
of the file to test the DOM's ready-state was 'finished' loading, the DOM 
didn't exist or wasn't parsed for whatever reason. The result is that the the 
body of the document was undefined.

This suggested that the process of loading jQuery 1.6 immediately after svgweb 
was somehow corrupting the process of parsing the entirety of the HTML file.  A 
point to note is that during testing, when loading just svgweb or just jQuery 
Internet Explorer had no issues parsing the entire document.  Somehow, the 
combination of svgweb and jQuery 1.6(.1) caused it to fail.

All this suggested that it was not a problem that could be fixed through syntax 
corrections (at least without far more in-depth knowledge of both projects).  
So, to try and give Internet Explorer a chance to parse the HTML before the 
scripts were loaded (and potentially corrupt the loading process) the scripts 
were moved to the end of the HTML file which solved the problem.

From what I have seen in dealing with this issue, I would lean towards this 
being a problem with the changes made to jQuery in 1.5.2->1.6 since that is 
when the error arose.  It is my best-guess that it is not a problem with 
svgweb, but I could be wrong.

Note: I had my svg included directly in the HTML with a <script 
type="image/svg+xml"> tag.  I have not tested things with the <embed> method of 
including SVG code.

Original comment by david.qu...@gmail.com on 22 Jun 2011 at 7:14

GoogleCodeExporter commented 8 years ago
Same issue! Thanks man!

Original comment by pedro.al...@webdetails.pt on 23 Aug 2011 at 10:30

GoogleCodeExporter commented 8 years ago
David, did you test to see if this still happens in 1.6.2?

Original comment by pmgal...@gmail.com on 9 Sep 2011 at 6:12

GoogleCodeExporter commented 8 years ago
Same/similar issue: 
jquery.min.js Object doesn't support this property or method Line: 2 Char: 9774

svgweb-2011-02-03-Lurker-Above.zip
Windows XP
Internet Explorer 8.0.6001.18702
Flash 11.4.402.278
jQuery v1.8.2

On simple web pages the error occurs ~100% of the time with the script tags in 
the head and ~0% of the time with the script tags just before </body>.

On complex web pages the error occurs ~90% of the time with the script tags in 
the head and ~20% of the time with the script tags just before </body>.

Original comment by haas...@gmail.com on 5 Oct 2012 at 7:57

GoogleCodeExporter commented 8 years ago
I think that the priority of this defect should be raised. JQuery is becoming 
an essential tool on every web page and SVGWEB not working with it is not an 
acceptable situation.

Original comment by PhilipGP...@gmail.com on 4 Jan 2013 at 9:28