Ok, from JS in Html:
alert("window.navigator.appName: "+window.navigator.appName);
alert("window.document.plugins
('FP').window.navigator.appName: "+window.document.plugins
('FP').window.navigator.appName);
var svgobj = window.document.embeds('FP').window.getDocument();
no problem
Paul
--- In [email protected], "riverside6" <[EMAIL PROTECTED]>
wrote:
>
> That definitely helps me to an extent. I understand now that if I
> have javascript in an SVG file itself, to reference the SVG object
I
> can do the following...
>
> var svgobj = document
>
> The problem is, I'm still struggling to find out how to access the
> svg object if I have the svg embedded and I want to manipulate the
> SVG via javascript in the HTML document.
>
> What's the comparable command if the embed is named FP? I thought
it
> was the following, but when I use this, I get "unspecified
error"...
>
> var svgobj = document.embeds("FP").getSVGDocument()
>
> Thanks again for your help, but can you clear this up for me?!?
>
> --- In [email protected], "welkerpaul"
<[EMAIL PROTECTED]>
> wrote:
> >
> > This tread confused me;-)
> >
> > I guess part of the muddle is that window isn't window and
document
> > is not document when it comes to html<->svg (script)
interaction.
> > Moreover, if you open a plain svg, the asv browser integration
> will
> > generate a html document on the fly; yet you do have a html
hosting
> > the svg (embed obj).
> >
> > window is not window: remember these windows are different
objects :
> > [in HTML]: browser window object (i.e. recognizes window.open,
> > window.opener, window.top, etc.)
> > [in SVG]: asv plug-in window object (i.e. recognizes
> > window.getSVGViewerVersion, window.contextMenu, etc.)
> >
> > again,
> > [in HTML]: window.document is the browser html document object
> > (i.e. recognizes document.body, document.all, etc.)
> > [in SVG]: window.document is the SVGDocument object (i.e.
> recognizes
> > document.childNodes, document.rootElement, etc.)
> >
> > roundtripping samples for illustration:
> >
> > [in HTML]: window.document['plugins']['0']['window']['document']
> > ['rootElement'] (->svg object type of SVGSVGElement,
> > window<>window, document<>document )
> > [in SVG]: window.parent['document']['parentWindow']['document']
=
> (-
> > > html object type of document, doc is doc)
> >
> > Give it a break, - ,
> > in asv 'window' is implemented as '_window_impl', and 'parent'
is
> > implemented as'__parent__' . (In asv6 'window.parent' is broken,
> > nevertheless 'window.__parent__' still works.)
> >
> > hth and didn't unduly confuse you;-)
> > Paul
> > --- In [email protected], "riverside6"
> <[EMAIL PROTECTED]>
> > wrote:
> > >
> > > Fred, you'll notice a post by myself earlier today referencing
> the
> > > same error. I'm also using IE, and on the getSVGDocument call
> > > get "Unspecified Error". Unlike you though, I'm using a
simple
> > asp
> > > page with the SVG embedded. I'd also appreciate any
suggestions.
> > >
> > > Thanks!
> > >
> > > --- In [email protected], Fred yahou <[EMAIL PROTECTED]>
> > wrote:
> > > > Hi,
> > > >
> > > > I am using a SVG document that interacts a lot with
> its "parent"
> > > HTML page, in
> > > > both direction:
> > > > HTML->SVG:
> > > > [in SVG]: window.myFunctionInSVG = myFunction;
> > > > [in HTML]: window.myFunctionInSVG();
> > > >
> > > > SVG->HTML
> > > > [in SVG]: parent.myFunctionInHTML();
> > > >
> > > > This works fine on my HTTP server.
> > > >
> > > > Then I save as a MHTML (Web Archive) file, eventually using
a
> > third
> > > party IE
> > > > plugin like "EZ Save MHTML", then tweaking directly the
> > resulting
> > > MHTML file
> > > > (because for an unknown reason it misses the SVG file and
its
> > > includes, so Im
> > > > adding it manually, "encoded").
> > > >
> > > > Now I am sure my MHTML file is complete and well-formed.
When I
> > > launch the .mht
> > > > file in IE (6.0), it dispays fine, SVG and HTML included,
but
> > the
> > > communication
> > > > between both "worlds" don't work anymore. And so the
> > interactivity.
> > > After some
> > > > debugging I have been able to sort out that:
> > > >
> > > > [in SVG]:
> > > > - "parent" and "top" _don't exist_, so the
> > parent.myFunctionInHTML
> > > () call is
> > > > not working: no error message, no exception on try/catch,
> > nothing,
> > > just stops
> > > > the script engine :-(
> > > > - window object does not look like being the same window
object
> > as
> > > seen on HTML
> > > > side. So window.myFunctionInSVG = myFunction works, but is
> > useless.
> > > >
> > > > [in HTML]:
> > > > - calling window.myFunctionInSVG() returns an error (no
> > specified
> > > property
> > > > blabla) because of the previous reason
> > > > - document.embeds["svg"].getSVGDocument() fails as well (!).
> > > Apparently the
> > > > first part of this statement gets the ASV3 plugin object,
but
> the
> > > > .getSVGDocument() throws an "unspecified error".
> > > >
> > > > I suspect a bug in the MHTML handling (eventually the domain
> > name,
> > > rather
> > > > complex in the context of a MHTML page). Because this
feature
> is
> > > important to
> > > > me, I am trying any possible workaround before giving up.
> > > >
> > > > I would be glad if anyone shares a begining of an answer to
> that
> > > issue. If you
> > > > did not get it, the purpose of all this is to be able to
send
> > > emails with
> > > > interactive SVG inlined, and have offline version of complex
> > > reports. The
> > > > targetted platform is windows/IE/office, so I am interested
in
> > any
> > > IE specific
> > > > solution.
> > > >
> > > > Thanks in advance
> > > >
> > > > Fred
> > > >
> > > >
> > > >
> > > >
> > > > __________________________________
> > > > Do you Yahoo!?
> > > > Make Yahoo! your home page
> > > > http://www.yahoo.com/r/hs
-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my
membership"
----
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/