开发者

Trailing Ampersand character not shown in jquery tooltip (only in IE)

开发者 https://www.devze.com 2023-04-04 15:50 出处:网络
When I have the Jquery tooltip applied on a image element, defined as such: <img id=\"c\" title=\"abc &amp; ced &amp;\" src=\"info.png\" />

When I have the Jquery tooltip applied on a image element, defined as such:

<img id="c" title="abc &amp; ced &amp;" src="info.png" />

The actual tooltip that is shown is:

"abc & ced "

In firefox, and when I add a trailing space after the last &amp, 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

0

精彩评论

暂无评论...
验证码 换一张
取 消