1023
end = 100; } if (end > content.length) { end = content.length; } var match_content = content.substr(start, end); // highlight all keywords keywords.forEach(function (keyword) { var regS = new RegExp(keyword, "gi"); match_content = match_content.replace(regS, "" + keyword + ""); }); str += "

" + match_content + "...

" } str += ""; } }); str += ""; $resultContent.innerHTML = str; }); } }); }; searchFunc('/search.xml', 'searchInput', 'searchResult'); });