Learning DHTML programming

B

Brent Ritchie

Hello,

I put up a small web application called SVG Creator, I'm developing it
as a learning exercise. The url is:
http://www3.sympatico.ca/brentritchie/. So far development is going
well, but; I am having problems getting cross browser compatability.

I use IE, Opera and Firefox as testing environments, but as soon as I
added in dynamic SVG routines, the web site stopped displaying properly
on IE and Firefox. I was hoping that someone could help a bit.

The problem started when I added the following tag:

<object data="./Content/Canvas.svg" id="Canvas" name="Canvas"
type="image/svg+xml" width="800" height="600"
onload="javascript:LoadCanvas()">
</object>

IE just wouldn't load it (I tried both adobe plugin v3.02 and v6), and
Firefox just wanted to download the svg file. I heard about using an
embed tag but I want to use XHTML-Strict and keep formatting for CSS.
Does any one have any ideas?

The source is at
http://www3.sympatico.ca/brentritchie/Soiurce/svgcreator.zip. If you
don't feel like going through the source then maybe comment on the site
in general?

Thanks,

Brent Ritchie
 
M

Martin Honnen

Brent Ritchie wrote:

The problem started when I added the following tag:

<object data="./Content/Canvas.svg" id="Canvas" name="Canvas"
type="image/svg+xml" width="800" height="600"
onload="javascript:LoadCanvas()">
^^^^^^
Where is onload defined as an attribute of the object element?
</object>

IE just wouldn't load it (I tried both adobe plugin v3.02 and v6), and
Firefox just wanted to download the svg file.

Configure you server to serve the SVG documents as image/svg+xml and I
am sure Firefox 1.5 will parse and render them. Currently you serve
application/octet-stream which is usually a fallback or indication of
some binary to download.

As for using object to embed the SVG document in an HTML document, you
need to be aware that IE/Adobe SVG viewer disable script in the SVG
document when object is used due to security holes. So iframe or embed
need to be used if you want to have script in the SVG document itself.
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top