Quotation mark issues using Tooltip with multiple languages

Hi,

I need to program some items with mouse-over texts in multilingual using tooltip. Some texts have single quote (e.g. Brand A's Audio) or double quotes (this is "xyz....") that are causing problems for tooltip to work. I am using javascript to display different languages. Here is an example:

<script language="javascript">

var y = "[% lang %]";

if( y == "EN") {

document.write('[% ToolTip("Brand A's Audio ", "Brand A's Audio โ€“ this is "xyz...." ") %]'); }

if( y == "FR") {

document.write('[% ToolTip("Audio de la marque A ", "Audio de la marque A โ€“ c'est "xyz...." ") %]');

}

</script>

What's the best way to solve this problem, quotations marks, to make tooltip work?

Thank you!

5 replies