Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Javascript (http://www.velocityreviews.com/forums/f68-javascript.html)
-   -   Learning DHTML programming (http://www.velocityreviews.com/forums/t926408-learning-dhtml-programming.html)

Brent Ritchie 08-15-2006 09:59 PM

Learning DHTML programming
 
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/brentritchi...svgcreator.zip. If you
don't feel like going through the source then maybe comment on the site
in general?

Thanks,

Brent Ritchie


Martin Honnen 08-16-2006 01:00 PM

Re: Learning DHTML programming
 


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?
<http://www.w3.org/TR/html4/struct/objects.html#edef-OBJECT>

> </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.


--

Martin Honnen
http://JavaScript.FAQTs.com/


All times are GMT. The time now is 05:52 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.