getSVGDocument() gives unspecified error

A

Ashish

I have a svg file which is embeded in HTML file like:

<embed id="svgroomindex"
src="http://in-dev-ashishm/SVG/11roomindex.svg" width="100%"
height="100%" />

I have a javascript function to get the svg document object:

// Returns the embedded SVG Document
function getSVGDocument(embedName) {
var plugin = document.embeds[0];
return plugin.getSVGDocument();
}

which I call in onload event of body

<body onload="svgDoc=getSVGDocument('svgroomindex');">

But I get a javascript error onload of HTML file: Unspecified Error

I have tried many variants but all gives the same error. What can be
the problem (with code or anything else)?

Thanks,
Ashish
 
J

Jim Ley

which I call in onload event of body

the SVG document won't be loaded in the embed by this time, do it
later - in fact use the SVG documents load event to tell its parent
when it's ready.

Events! That's the way to go.

Jim.
 
A

Ashish

Now I removed onload from body in HTML and in SVG file svg tag I added
onload="fn_init()"

Also in SVG I have written fn_init() function.

<script type="text/ecmascript">
<![CDATA[
function fn_init(){
parent.fn_initialize();
}
]]>
</script>

In fn_init I want to call initialize() function which is in the HTML
which embeds this SVG.

But this also is not working.

Thanks,
Ashish
 
J

Jim Ley

Now I removed onload from body in HTML and in SVG file svg tag I added
onload="fn_init()"
In fn_init I want to call initialize() function which is in the HTML
which embeds this SVG.

I think we need more information, and it might be better at the svg
developers mailing list:
news://news.gmane.org/gmane.text.xml.svg.devel

Jim.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top