Title: Reload js files
Last modified: August 22, 2016

---

# Reload js files

 *  [onigetoc](https://wordpress.org/support/users/onigetoc/)
 * (@onigetoc)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/reload-js-files/)
 * After Hours and days of test and research, i finally find a way to reload the
   js files i need to make it work correctly.
 * In my test masonry didn’t reload well i it get me really mad.
    the masonry.js
 * around line 140
    i do not understand why AWS only search script in the body. 
   i changed this
 *     ```
       $scripts = $dataBody.find('#document-script'); // only fetch de body
       $scripts = $data.find('#document-script'); // fetch the whole document
       ```
   
 * Ok, now we don’t want to reload some js file
    around line 180
 *     ```
       if ( '' != scriptText ) {
       scriptNode = document.createElement('script');
       scriptNode.appendChild(document.createTextNode(scriptText));
       contentNode.appendChild(scriptNode);
       } else { // GC modif
   
       var thisSRC = $(this).attr('src');
   
       if ( (/ajaxify.js/i.test(thisSRC))||(/history.js/i.test(thisSRC))||(/myjsfile.js/i.test(thisSRC)) ) {
       //do nothing
       }else{
       $.getScript(thisSRC);
        }
       }
       ```
   
 * Now scripts reload well and Masonry is working again
 * In the AWS admin it would be interesting to add a js files exclusion like
    myscripts.
   js,otherscript.js
 * [https://wordpress.org/plugins/ajaxify-wordpress-site/](https://wordpress.org/plugins/ajaxify-wordpress-site/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Manish Kumar Agarwal](https://wordpress.org/support/users/manishkrag/)
 * (@manishkrag)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/reload-js-files/#post-5654002)
 * good job

Viewing 1 replies (of 1 total)

The topic ‘Reload js files’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ajaxify-wordpress-site.svg)
 * [Ajaxify Wordpress Site(AWS)](https://wordpress.org/plugins/ajaxify-wordpress-site/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ajaxify-wordpress-site/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ajaxify-wordpress-site/)
 * [Active Topics](https://wordpress.org/support/plugin/ajaxify-wordpress-site/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ajaxify-wordpress-site/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ajaxify-wordpress-site/reviews/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [Manish Kumar Agarwal](https://wordpress.org/support/users/manishkrag/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/reload-js-files/#post-5654002)
 * Status: not resolved