On Thu, 03 May 2007 22:48:07 +0200, jordangcsnt <[EMAIL PROTECTED]>  
wrote:

> Hi, i have a .js and I want it calls another .js, I tried to do it
> with document.write but it doesn't work, there is a message, it shows:
> the object doesn't accept this property or method.
> I have this:
>
> <svg xmlns:svg="http://www.w3.org/2000/svg";
> xmlns="http://www.w3.org/2000/svg";
> xmlns:xlink="http://www.w3.org/1999/xlink"; width="100%" height="100%"
> onload="Init(evt)">
> <script xlink:href="begin.js" />
>
> this is begin.js
>
> function Init(evt)
> {
>    svgDocument = evt.target.ownerDocument;
>    svgRoot = svgDocument.documentElement;
>    var url = prueba.js;
>    document.write('<SCRIPT src="' + url + '"><\/SCRIPT>');
> }
>
> I know that document.write doesn't work in xml  but someone knows how
>  i can call the other js???, thanks

This won't work for a couple of reasons:
a) Looking at the SVGDocument object there is no 'write' method, that's  
only available on HTMLDocument objects.
b) "<SCRIPT>" is not an SVG element, since XML is case-sensitive, should  
be "<script>"
c) There is no "src" attribute on <script> elements in svg, you should use  
"xlink:href" instead

So, instead try:
var script = document.createElementNS("http://www.w3.org/2000/svg";,  
"script");
script.setAttributeNS("http://www.w3.org/1999/xlink";, "xlink:href", url);
svgRoot.appendChild(script);

Hope this helps
/Erik

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/svg-developers/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to