I'm trying to use Jets.js for in page search of a series of unordered lists, but I keep getting this error with a single ul:
jets.js:23 Uncaught Error: Error! Could not find searchTag element
(anonymous function) @ jets.js:23
Jets @ jets.js:17
(anonymous function) @ index.html:34
The JavaScript is:
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jets/0.11.0/jets.js"></script>
<script>
var jets = new Jets({
searchTag: '#jetsSearch',
contentTag: '.jetsContent',
searchSelector: '*OR'
});
</script>
and the HTML is:
<input type="search" id="jetsSearch">
<ul class="jetsContent">
<li>
<span class="icon major style1 fa-code"></span>
<h3>Ipsum consequat</h3>
<p>Sed lorem amet ipsum dolor et amet nullam consequat a feugiat consequat tempus veroeros sed consequat.</p>
</li>
<li>
<span class="icon major style3 fa-copy"></span>
<h3>Amed sed feugiat</h3>
<p>Sed lorem amet ipsum dolor et amet nullam consequat a feugiat consequat tempus veroeros sed consequat.</p>
</li>
<li>
<span class="icon major style5 fa-diamond"></span>
<h3>Dolor nullam</h3>
<p>Sed lorem amet ipsum dolor et amet nullam consequat a feugiat consequat tempus veroeros sed consequat.</p>
</li>
</ul>
Try this:
var pre = onload;
onload = function(){
if(pre)pre();
var jets = new Jets({
searchTag: '#jetsSearch',
contentTag: '.jetsContent',
searchSelector: '*OR'
});
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.