getURL/parseXML does not work [Archive] - XML Elves

getURL/parseXML does not work

Anonymous
08-08-2005, 02:37 PM
Hi there,

I have a very simple code for getURL() and parseURL() which works just fine when I run svg file as standalone page. But it does not work when I render the same svg file through webserver!

The code is:

<?xml version="1.0" standalone="no"?>

<svg width="800" height="500" xmlns="http&#58;//www.w3.org/2000/svg" onload="init&#40;evt&#41;">
<desc>On Click Presence </desc>
<defs>
<script type="text/ecmascript"><!&#91;CDATA&#91;
var svgDoc;

function init&#40;evt&#41;&#123;
svgDoc = evt.getTarget&#40;&#41;.getOwnerDocument&#40;&#41;;
&#125;

function go&#40;&#41; &#123;
getURL&#40;somehtml.html',fn&#41;

&#125;

function fn&#40;obj&#41; &#123;
alert&#40;"comes to fn"&#41;;
var root = parseXML&#40;obj.content, svgDoc&#41;.firstChild;

var nchild=root.lastChild;
alert&#40;"Done!!"&#41;;

&#125;

&#93;&#93;></script>

</defs>
<rect onclick="go&#40;evt&#41;" id="Box1" x="125" y="100" width="200" height="100" stroke="blue" fill="white"/>
</svg>


and the html file is:
<html>
<head>
</head>
<body>
Test
</body>
</html>


I would really appreciate it if someone can throw some light on this subject.

Thanks.

 
Web mp2kmag.com
mapforums.com

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum