On Fri, 18 Feb 2005 23:17:26 -0000, Jan <[EMAIL PROTECTED]> wrote: > > > I'm developing a web site using svg, php, Javascript, and html. It > is a traffic map application that has layer controls, zooming, > panning, etc. The svg for the map is generated by php code and then > displayed and is embedded within the html. The map will also display > icons for traffic incidents. The page will also allow for a textual > listing of the traffic incidents by clicking on an html link. > > The problem I have right now is that the traffic incident data will > be stored within a Javascript array within the svg for the map and is > not available to the containing html parent. I found a solution for > communicating between html and svg that works in IE, but I don't > believe it will work in Netscape or Mozilla.
This depends on whether you're talking about Mozilla with native SVG support, or Mozilla with the ASV 6 alpha installed. ASV does not support scripting to and from Mozilla, and I guess they will wait until they finalise ASV 6 before adding that support, so forget about scripting between the two documents in this case. At the moment if you want to embed SVG by reference into an HTML file, Mozilla with native SVG will support direct script access from the HTML to the SVG if you use the <object> or <iframe> tags. Currently the <embed> tag does not allow you to script from the HTML to the SVG document directly. (I plan to write a patch to add a contentDocument attribute or getSVGDocument method to the 'embed' object, but unfortunately I'm unlikely to get to this before SVG is built into the official Mozilla 1.8 (hopefully) builds.) If you want to script across <embed> you will need to push a reference to the SVG document up to the HTML document first. Since ASV has removed the script link between itself and IE if the SVG is embeded using the <object> tag I would imagine that you are using the <embed> or <iframe> tag. To create a link between the HTML and SVG document for Mozilla put something like the following in a script in your SVG document. top.svgDoc = document; // creates a reference in the HTML to the SVG document top.svgWin = window; // creates a reference in the HTML to the SVG document's 'window' Scripts in your HTML document can then check for window.svgDoc and window.svgWin and use them once they've been set. > My question is: how are most people developing their svg sites, > especially map sites? Are most people doing everything in svg and > are most people using a combination of svg and html? If so, how is > the communication between the two done so that things work in both > browsers? > > Should I be developing my map controls and links in svg as well > instead of trying to communicate between html and svg? > > Jan > ----- 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/