开发者

jQuery highlighting special characters in text

开发者 https://www.devze.com 2022-12-08 17:37 出处:网络
I am using JavaScript text higlighting jQuery plugin http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html

I am using

JavaScript text higlighting jQuery plugin http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html

It works well for me all the time, except for some symbol开发者_运维技巧s:

$("#preview").highlight($(this).val(), { wordsOnly: true, className: 'blacklist'});

if "$(this).val()" equals to either €, $ or £ - highlight plugin doesn't work. Any idea what it could be?


Don't know exacly why it doesn't work, but the plugin is intended to highlight words/chars, not really special chars. It may have to do with that fact, being special chars. Check if the code you're trying to highlight isn't encoding those special chars to something like €

0

精彩评论

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