Hi, Zafar-
This is the sort of thing that's covered in the CDF Working Group's new
WICD specs. I've got an example on my site. [1]
To pass parameters to an SVG, use the <object> element with child
<param> elements. Each <param> element should have name/value pairs with
the 'name' and 'value' attributes; these will be exposed to the embedded
SVG document. The actual values are not necessarily specified, and can
be arbitrary strings, though there are a few formal parameter
name/values. An example of the HTML markup is:
<object type="image/svg+xml" data="embeddedDoc.svg">
<param name="color" value="orange" />
<param name="label" value="some text" />
</object>
The code for the script to access these parameterized values in the
embedded SVG might look like this:
var params =
document.defaultView.frameElement.getElementsByTagName('param');
for ( var i = 0, iLen = params.length; iLen > i; i++ )
{
var eachParam = params[ i ];
var name = eachParam.getAttribute( 'name' );
var value = eachParam.getAttribute( 'value' );
//do something here with the values;
}
My bank account number is... ;)
[1] http://www.schepers.cc/examples/pass-params.html
Regards-
-Doug
ztminhas wrote (on 11/6/2007 7:02 AM):
> Hi,
>
> I have to figure out something pretty soon so I would appreciate your
> assistance. I have a SVG file which needs to display some data from a
> server or a local server side variable, or from a java script variable.
> I would like to know if it is possible to use the param tag to
> accomplish this:
>
>
> <object type="image/svg+xml" id="svgdocHead" data="embfiles/head.svg"
> width="599px" height="55px">
> <param name="src" value="embfiles/head.svg">
> <param name="left" value="100"/>
> <param name="right" value="500"/>
> </object>
>
> where the values in the param tag could indicate some kind of values
> that the svg could read, in manner very similar to how an applet can
> read param values.
>
> If there is a way to accomplish this, could you please let me know? I am
> even willing to pay for the help, so send me your account numbers! :-)
>
> Best Regards
>
> Zafar T Minhas
>
>
-----
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/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/svg-developers/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> 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/