Title: Infinitely loading javascript
Last modified: August 21, 2016

---

# Infinitely loading javascript

 *  [Emma Edgar Valcq](https://wordpress.org/support/users/emmaee/)
 * (@emmaee)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/infinitely-loading-javascript/)
 * Hi,
 * I needed an easy way to highlight search terms on my site and your plugin worked
   pretty well. However, I had an issue when going to my home page from a search
   results page. The javascript for your plugin would load, then about 5 other plugin
   javascript files, then it would start loading yours again until the page died.
 * This would only happen on the home page, and only if I went to the home page 
   FROM a search results page. I turned on Debug mode but no errors were thrown.
   I started deactivating plugins and only when I deactivated this plugin, did the
   homepage load properly.
 * I have moved on to using the built-in highlighting functionality of a search 
   plugin that I needed anyway, but I wanted to inform you of the issue so you can
   fix it and make your plugin better. I think it has a lot of potential.
 * Keep up the good work! 🙂
 * Emma
 * [http://wordpress.org/plugins/highlight-search-terms/](http://wordpress.org/plugins/highlight-search-terms/)

Viewing 12 replies - 1 through 12 (of 12 total)

 *  Plugin Author [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * (@ravanh)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/infinitely-loading-javascript/#post-4449435)
 * Hi Emma, thanks for reporting.
 * It sounds like a conflict with your theme. Can you tell me which theme you were
   using or is it a custom theme? I would need to see it live or be able to reproduce
   the issue to start debugging.
 *  Thread Starter [Emma Edgar Valcq](https://wordpress.org/support/users/emmaee/)
 * (@emmaee)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/infinitely-loading-javascript/#post-4449436)
 * I work for a WordPress shop so, unfortunately in this case, it is a custom theme
   and the site has already been launched, so I can’t do any testing on it. 🙁
 *  [differentC@rl](https://wordpress.org/support/users/differentcrl/)
 * (@differentcrl)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/infinitely-loading-javascript/#post-4449507)
 * emmaee – I know it’s been a couple of months but did you find a fix for your 
   issue?
 * I’m having the same problem with a custom theme I’ve built too; the highlight
   only happens when I return to the home page.
 * Thanks in advance.
 *  Thread Starter [Emma Edgar Valcq](https://wordpress.org/support/users/emmaee/)
 * (@emmaee)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/infinitely-loading-javascript/#post-4449508)
 * Hi differentc@rl, no I didn’t. We were on a tight schedule so I switched to a
   different plugin before I found a solution. Sorry.
 *  [differentC@rl](https://wordpress.org/support/users/differentcrl/)
 * (@differentcrl)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/infinitely-loading-javascript/#post-4449509)
 * I see! Nevermind. Thanks for the quick reply emmaee.
 *  Plugin Author [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * (@ravanh)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/infinitely-loading-javascript/#post-4449510)
 * [@all](https://wordpress.org/support/users/all/), like I wrote before I need 
   to see it live to debug. Please share a link if you want me to take a look 🙂
 *  [differentC@rl](https://wordpress.org/support/users/differentcrl/)
 * (@differentcrl)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/infinitely-loading-javascript/#post-4449511)
 * Thanks RavanH – here’s a link [http://everythingdifferent.co.uk/](http://everythingdifferent.co.uk/)
 * If you search for a term and then return to home page the term will be highlighted
   on the homepage too!
 * Thanks in advance!
 *  Plugin Author [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * (@ravanh)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/infinitely-loading-javascript/#post-4449512)
 * [@carl](https://wordpress.org/support/users/carl/) – I tested with [http://everythingdifferent.co.uk/?s=tyne](http://everythingdifferent.co.uk/?s=tyne)
   then clicking Home but I don’t see the highlights. Anyway, it’s a known issue
   which is in fact on purpose. The idea is to continue the highlighting after a
   search result is clicked. It’s hard to prevent the same thing happening when 
   it’s actually a menu item that is clicked after the search…
 *  [differentC@rl](https://wordpress.org/support/users/differentcrl/)
 * (@differentcrl)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/infinitely-loading-javascript/#post-4449513)
 * Hmmm for some reason it doesn’t effect the main story (largest item).
 * If you try [http://everythingdifferent.co.uk/?s=health](http://everythingdifferent.co.uk/?s=health)
   and return to home page you’ll see the first story is being highlighted..
 * There must be something that the main story is doing that stops the highlighting
   from happening – any ideas?
 * Also, why would it only be if I go to the home page – the problem doesn’t happen
   on any other page?!
 * Thanks again
 *  Plugin Author [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * (@ravanh)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/infinitely-loading-javascript/#post-4449514)
 * > There must be something that the main story is doing that stops the highlighting
   > from happening – any ideas?
 * Probably because it is not wrapped in `<article>` tags on the home page. Same
   for all single posts… The plugin tries to limit highlighting to post content 
   but the javascript needs to know how te recognise post content. It searches for
   commonly used wrappers like `<article>` or divs that use a class or ID like `
   hentry`,`content`,`post`,`page` etc… Your theme uses none of these.
 * The next version of this plugin will have an option to adapt the sections it 
   looks for to fit your theme.
 *  [differentC@rl](https://wordpress.org/support/users/differentcrl/)
 * (@differentcrl)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/infinitely-loading-javascript/#post-4449515)
 * Thanks for the feedback RavanH – I’ll have a look at a fix myself in the meantime!
 *  [differentC@rl](https://wordpress.org/support/users/differentcrl/)
 * (@differentcrl)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/infinitely-loading-javascript/#post-4449516)
 * Changing `<articles>` to `<divs>` fixed the issue – thanks again RavanH

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Infinitely loading javascript’ is closed to new replies.

 * ![](https://ps.w.org/highlight-search-terms/assets/icon-128x128.png?rev=1112135)
 * [Highlight Search Terms](https://wordpress.org/plugins/highlight-search-terms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/highlight-search-terms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/highlight-search-terms/)
 * [Active Topics](https://wordpress.org/support/plugin/highlight-search-terms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/highlight-search-terms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/highlight-search-terms/reviews/)

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [loading](https://wordpress.org/support/topic-tag/loading/)

 * 12 replies
 * 3 participants
 * Last reply from: [differentC@rl](https://wordpress.org/support/users/differentcrl/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/infinitely-loading-javascript/#post-4449516)
 * Status: not resolved