Learning DHTML programming

Discussion in 'Javascript' started by Brent Ritchie, Aug 15, 2006.

  1. 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
    Brent Ritchie, Aug 15, 2006
    #1
    1. Advertising

  2. 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/
    Martin Honnen, Aug 16, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. the_philospher

    Learning game programming timescales

    the_philospher, Mar 1, 2005, in forum: C++
    Replies:
    9
    Views:
    552
    the_philosopher
    Mar 1, 2005
  2. Hal Vaughan
    Replies:
    7
    Views:
    472
  3. Andrey Popp

    [I'm learning C]: Learning to use ucontext

    Andrey Popp, Jan 29, 2012, in forum: C Programming
    Replies:
    5
    Views:
    705
    Keith Thompson
    Jan 31, 2012
  4. Laura Williams

    dhtml/programming languages

    Laura Williams, Nov 23, 2004, in forum: Javascript
    Replies:
    9
    Views:
    104
    Hal Rosser
    Nov 25, 2004
  5. Steve
    Replies:
    1
    Views:
    279
    Richard Cornford
    Apr 9, 2005
Loading...

Share This Page