59614Re: [svg-developers] Re: Create script element
- Nov 27 7:11 PMHi Nico,
What a fun problem!
I fiddled around with it just enough to confirm what seems like odd behavior in the browsers:
The enclosed code (with a simple .js file of some sort added on ) shows very different behavior in Opera 9.5alpha, FF1.5 and IE
with FF able to run the code from the <script> built through DOM. FF behaves the way I would expect it to.
Since FF works the way I expect it should, it is probably the one which is buggy. Erik Dahlstrom has pointed out that some of the CDATA hoopla that I typically use is more extravagant than it needs to be, so in this context my extraneous hoopla could prove problematic since it does pop up as the nodeValue of the script that is commented out. Erik and maybe Martin H. have also mentioned the use of href.baseVal in setting xlinks, but this is on my list of things to ask about sometime, so am not sure why or when one would do that.
<svg xmlns="http://www.w3.org/2000/svg" width="100%"
viewBox="0 0 100 100">
var s = document.createElementNS(svgNS,"script");
<rect x="0" y="0" id="R" height="100" width="100" fill="red" />
----- Original Message -----
From: Domenico Strazzullo
Sent: Tuesday, November 27, 2007 5:18 PM
Subject: [svg-developers] Re: Create script element
it got truncated, here it is.
Can anyone confirm that the following works (or doesn't work)?:
var s = svgdoc.createElementNS(svgNS,"script");
After loading and parsing an external file the script linked to that
file is dumb. Same if the script is inline. Then I tried the above with
no luck. Can anyone suggest an alternate method, other than hardcoding
the script tag in the first file(the script filename is not necessarily
known in advance)?
--- In firstname.lastname@example.org, "Domenico Strazzullo" <nst@...>
> Can anyone confirm that the following works (or doesn
[Non-text portions of this message have been removed]
- << Previous post in topic Next post in topic >>