how to dynamically embed the svg [Archive] - XML Elves

how to dynamically embed the svg

Sushmitha
07-08-2005, 03:27 AM
hi,
I am having an html file and in the html i have embedded a svg file called trial1.svg using embed tag....
and having 2 text boxes and 1 button...
suppose if i want to load dynamically another svg file called trial2.svg in the same place where the previous svg displayed, how should i do..
remaining things in the html should not be changed...
and suppose if i did so.. will it be possible for me to access the nodes of trial2.svg

please help me and give me a reply
Thanks,
Sushmitha

Hacc
07-27-2005, 08:00 AM
Hi

I haven't tested it, but the following should work:

<script language="javascript">
function change_SVGDoc(){
document.all("svgimage").src = "example2.svg"
}
</script>

<html>
<body>
...
<embed name="svgimage" src="example1.svg" width="100%"height="100%" type="image/svg+xml"/>
<input type="button" name="button" value="click me" onclick="change_SVGDoc()"/>
</body>
</html>

Using java script won't reload your html page and your html fields will keep their values.
Can you give more details on your question "how to access the nodes of trail2.svg"?

Hope this helps!
Hacc

 
Web mp2kmag.com
mapforums.com

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum