javascript - Highlight Text plugin breaks when using with array string -
javascript - Highlight Text plugin breaks when using with array string -
i trying utilize jquery based text highlight plugin, works single word highlight breaks when pass array, syntax seems right the documentation http://bartaz.github.io/sandbox.js/jquery.highlight.html
example: http://jsfiddle.net/yyaxp/6/
//$('#article').highlight("me"); $("#article").highlight(["me","highlight","plugin"]);
i need pass several keywords function highlight of them.
solved:
it seems script had bug resolved utilize next fiddle finish script array based search highlight script source
fiddle: http://fiddle.jshell.net/ogyyvvog/2/
it gets error when running code
pat.touppercase not function
pat should array, maybe can prepare in way?
return this.length && pat && pat.length ? this.each(function () { for(var i=0;i<pat.length;i++) innerhighlight(this, pat[i].touppercase()); }) : this;
jsfiddle
javascript jquery
Comments
Post a Comment