getSVGDocument() gives unspecified error

Discussion in 'Javascript' started by Ashish, Oct 4, 2004.

  1. Ashish

    Ashish Guest

    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
    Ashish, Oct 4, 2004
    #1
    1. Advertising

  2. Ashish

    Jim Ley Guest

    On 4 Oct 2004 06:22:13 -0700, (Ashish) wrote:


    >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.
    Jim Ley, Oct 4, 2004
    #2
    1. Advertising

  3. Ashish

    Ashish Guest

    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

    (Jim Ley) wrote in message news:<>...
    > On 4 Oct 2004 06:22:13 -0700, (Ashish) wrote:
    >
    >
    > >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.
    Ashish, Oct 5, 2004
    #3
  4. Ashish

    Jim Ley Guest

    On 4 Oct 2004 22:14:33 -0700, (Ashish) wrote:

    >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.
    Jim Ley, Oct 5, 2004
    #4
  5. Ashish Mundra, Oct 7, 2004
    #5
  6. Hi Jim,

    Thanks for the help. Actually today I discovered that my original code
    works when I access web page (in ASP.NET) using
    http://machine-name/....aspx but it do not work when I access it by
    localhost in URL, i.e. http://localhost/....aspx.
    I do not know the reason, but it's strange.

    Thanks,
    Ashish



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Ashish Mundra, Oct 7, 2004
    #6
    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. RM
    Replies:
    3
    Views:
    607
    Yan-Hong Huang[MSFT]
    Aug 19, 2003
  2. Jim Lacenski
    Replies:
    1
    Views:
    2,771
    Natty Gur
    Oct 18, 2003
  3. Gatsu
    Replies:
    2
    Views:
    327
    Gatsu
    Sep 5, 2008
  4. abcd
    Replies:
    0
    Views:
    160
  5. abcd
    Replies:
    0
    Views:
    122
Loading...

Share This Page