hi sam no, you can't on a client machine that accesses two different servers. that is not a SVG issue but has been that way back in 1997 when i first had this problem. this is a client side script security reason.
you need to make the reading code AND the svg coming form one unique domain, there is no workaround on the client side. andré -- ___________________________________________________________________ andre m. winter, cartography for internet and multimedia applications schiessstand 4/1, a6091 goetzens, tyrol, austria tel.: ++43.5234.32732 email: <[EMAIL PROTECTED]> <http://www.vectoreal.com/> SVG consulting and development <http://svg.carto.net/> online cartography focusing on SVG <http://www.carto.at/> print and online touristic map solutions samcctan wrote: >Thanks Andreas! >I think I understand what you mean here. I am very new in this area. >So hope you don't mind if I ask any of the silly questions. > >Is there any other codes that enable me to read any svg file in the >webpage? I am actually creating a plugin for Firefox (as IE is more >strict in its security matter), which able to do read svg file from >any of the webpage (doesn't matter where those svg loaded from - >which server). > >Is there any other ways to do so? > >Thanks, > >Sam > >--- In svg-developers@yahoogroups.com, "Andreas Neumann" ><[EMAIL PROTECTED]> wrote: > > >>Hi, >> >>this looks like you are running into the security restrictions. >> >>With .getURL and XMLHttpRequest you can only read data from the >> >> >same > > >>source than the original HTML/SVG file comes from. This means that >>if you read the original file from the local machine you can only >>get data from the local machine. Likewise, if you load the svg from >>webserver A you can only do the getURL/XMLHttpRequests to server A >>and not to server B. >> >>There is no workaround other than using server A as a proxy for >>server B, if you need to access server B. >> >>Andreas >> >> >>--- In svg-developers@yahoogroups.com, "samcctan" <[EMAIL PROTECTED]> >>wrote: >> >> >>>Hi all, >>> >>>I am using JavaScript to read SVG file. At this moment I am >>> >>> >>reading >> >> >>>from a local SVG file and it is working. But now, I am going to >>> >>> >>want >> >> >>>to read SVG file from the webpage. >>> >>>This is my code to read local SVG file (from local machine): >>> >>>function init(){ >>> >>> readXML("SVGBarGraph.svg"); >>> loadFile(); >>>} >>>function readXML(url){ >>> if (window.XMLHttpRequest) { >>> req = new XMLHttpRequest(); >>> req.overrideMimeType ("text/xml"); >>> req.onreadystatechange = processReqChange; >>> req.open("GET", url, true); >>> req.send(null); >>> } else if (window.ActiveXObject) { >>> req = new ActiveXObject("Microsoft.XMLHTTP"); >>> if (req) { >>> req.onreadystatechange = processReqChange; >>> req.open("GET", url, true); >>> req.send(); >>> } >>> } >>>} >>> >>>function processReqChange() { >>> >>> if (req.readyState == 4 && req.responseXML) { >>> var resp = req.responseXML; >>> parseSVGFile(resp); >>> } >>>} >>> >>>function parseSVGFile(svgDOM){ >>> ....... (my codes) >>>} >>> >>>Could anyone help me or give me some advices? >>> >>>Thanks in advance, >>> >>>Sam >>> >>> > > > > > > >----- >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 > > > > > > > > ------------------------ Yahoo! Groups Sponsor --------------------~--> <font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12h9knhob/M=362131.6882499.7825260.1510227/D=groups/S=1706030389:TM/Y=YAHOO/EXP=1123770502/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org ">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life - brought to you by One Economy</a>.</font> --------------------------------------------------------------------~-> ----- 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/