Trailing Ampersand character not shown in jquery tooltip (only in IE)
When I have the Jquery tooltip applied on a image element, defined as such:
<img id="c" title="abc & ced &" src="info.png" />
The actual tooltip that is shown is:
"abc & ced "
In firefox, and when I add a trailing space after the last &
, it works as intended:
"abc & ced &"
Is this an I开发者_JS百科E bug? I seem to be having it in version 7, 8 and 9 of IE...
Edit; the Jquery tooltip used is the one from http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/
Crazy stuff. Weird IE bug somehow.
$("a")[0].innerHTML = "error & error &"
//IE removes "&" at the end
The tooltip plugin sets the innerHTML of his helper element. IE removes trailing "&"
1) double-escape it (title looks wrong on non-JS browsers, works fine everywhere else)
2) Change .html() to .text() in the tooltip plugin. Titles including html code will fail.
3) Trailing space workaround
4) inspect further
精彩评论