getSVGDocument() gives unspecified error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ashish

    getSVGDocument() gives unspecified error

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

    <embed id="svgroominde x"
    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.getSVGDo cument();
    }

    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
  • Jim Ley

    #2
    Re: getSVGDocument( ) gives unspecified error

    On 4 Oct 2004 06:22:13 -0700, ashish.mundra@g mail.com (Ashish) wrote:

    [color=blue]
    >which I call in onload event of body[/color]

    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.

    Comment

    • Ashish

      #3
      Re: getSVGDocument( ) gives unspecified error

      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_initi alize();
      }
      ]]>
      </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@jibbering.c om (Jim Ley) wrote in message news:<416150a1. 17579427@news.i ndividual.net>. ..[color=blue]
      > On 4 Oct 2004 06:22:13 -0700, ashish.mundra@g mail.com (Ashish) wrote:
      >
      >[color=green]
      > >which I call in onload event of body[/color]
      >
      > 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.[/color]

      Comment

      • Jim Ley

        #4
        Re: getSVGDocument( ) gives unspecified error

        On 4 Oct 2004 22:14:33 -0700, ashish.mundra@g mail.com (Ashish) wrote:
        [color=blue]
        >Now I removed onload from body in HTML and in SVG file svg tag I added
        >onload="fn_ini t()"
        >In fn_init I want to call initialize() function which is in the HTML
        >which embeds this SVG.[/color]

        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.

        Comment

        • Ashish Mundra

          #5
          Re: getSVGDocument( ) gives unspecified error





          *** Sent via Developersdex http://www.developersdex.com ***
          Don't just participate in USENET...get rewarded for it!

          Comment

          • Ashish Mundra

            #6
            Re: getSVGDocument( ) gives unspecified error

            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!

            Comment

            Working...