Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Highlighted
Developer
Posts: 39
Registered: ‎03-01-2011
My Device: PlayBook
My Carrier: AT&T

pass values between html and embedded svg file

it looks like there are ways to pass values between the html file and svg file that i have embedded within the document using url parameters:

 

in html file:

 

 

<object type="image/svg+xml" data="button.svg param1=value1&param2=value2"></object>

 

in svg file:

 

 

 

// get param elements from referencing object element 
  var params = document.defaultView.location.href.split("?")[1].split("&");
  // split name/value pairs
  ...
  // find elements that need to be changed, then set values to to parameter value
  ...

 

 

here's the page i'm referencing:

 

SVG Reference

 

this is a snippet using the <object> tag.  has anyone done this for the <embed> tag and got it to work in webworks?  is there something i need to add in the config.xml file?  basically when i make a selection in my menu on the html side, i want that value passed to the svg to update the variable i selected, let's say.

 

many thanks on any help provided!