I am assuming that you would like to do something like
link_to_remote("click",:update=>"svg_id"...)
If that is the case you could do
link_to_remote("click",:update=>"",:complete=>"init_svg(''svg_id'',
request.responseText)"...)
function init_svg(svg_id, content){
do_whatever(top.document.embeds[0].getSVGDocument().getElemen>
> tById(svg_id), content)
>
}
You should check in prototype.js if $() accepts objects and not just the id
string (I suspect that it does)
bogdan
On 2/28/06, Henrique Testa <anon1@caracol.inf.br>
wrote:>
> Hi,
> In my project, there is an rhtml page with an embedded SVG file. In my
> javascript functions, I can find an object by id inside the SVG file
> with the following:
>
> ObjectInSVG >
top.document.embeds[0].getSVGDocument().getElementById("rect");
>
> Now, I want to use Ajax methods, like link_to_remote, in the rhtml page
> to manipulate the SVG objects. The problem is that link_to_remote method
> uses the id to identify the object... but the object is embedded! Is
> there any way to pass the object reference to the link_to_remote instead
> of just the id?
>
> Thanks for the help!
>
> Henrique
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060228/4975006f/attachment-0001.html