Actually the calling document does not matter, BUT the document
associated with the parseXML does...

 

In many cases I use AJAX to get an svg segment and then I just use one
of the svg's on my html page to parse the returned text into XML and
then use it...

 

  _____  

From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Sean
Sent: Wednesday, June 28, 2006 12:01 PM
To: [email protected]
Subject: Re: [svg-developers] getURL/XMLHTTP

 

This appears to be a an issue harder to solve than I thought it would 
be. Below is my javascript code that for the most part works, except for

one thing, the Adobe viewer won't let me call getURL, parse it with 
parseXML, and then insert into an svg doc that is not the calling 
document. I get:

---------------------------
Script error
---------------------------
Wrong document
line: 22, column: 16

Any thoughts on how to get around this would be very much appreciated.

// JavaScript Document
function addMenu(evt){
myUrlString = ("F4-Test.php?&menu=Planning");
getURL(myUrlString,addMenu2);
}

function addMenu2(data) {
// alert(data.content);
if(data.success) {
var node = parseXML(data.content, document);
var xml = node.firstChild;
var id = xml.getAttribute('id');
var myMenuToAdd;
child = node.firstChild.firstChild;
while(child != null){
// get sibling BEFORE parent changes
childSibling = child.nextSibling;
if(child.nodeType==1){
// alert(window.printNode(child));
myMenuToAdd = 
parent.document.F4B.getSVGDocument().getElementById("PlanningCanvas");
myMenuToAdd.appendChild(child);
}
child = childSibling;
}
}else {
alert("something went wrong!");
}
}

 



[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
See what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/1U_rlB/TM
--------------------------------------------------------------------~-> 

-----
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/

<*> 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