Can I use SCRIPT tags inside a tooltip?

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Laura Gilbert on 6th May 2013
If I write text into a tooltip containing say <div> or <img> tags it works perfectly. However it appears to ignore <script> tags (so I can't make it throw out a javascript alert, say). Is that expected behaviour? Is there a work around?
I ask because I'm trying to display a google map in a tooltip and it's proving pesky.
Many thanks,
Posted by RGraph support on 6th May 2013
Hi there,

You can add <script> tags to tooltips by breaking up the closing script tag - however because the content of the tooltip is assigned by innerHTML - the JavaScript won't be executed.

obj.Set('chart.tooltips', ['<scr' + 'ipt>alert(4678678);</scr' + 'ipt>' ...]);

Richard, RGraph Support

Add a reply

« Back to message list