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.
Same issue! Thanks man!
David, did you test to see if this still happens in 1.6.2?