Title: Invalid Argument Javascript Errors &#8211; solution
Last modified: August 21, 2016

---

# Invalid Argument Javascript Errors – solution

 *  [L O Lawson](https://wordpress.org/support/users/l-o-lawson/)
 * (@l-o-lawson)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/invalid-argument-javascript-errors-solution/)
 * shutter.js and shutter_reloaded.js were throwing javascript errors on lines 36
   and 44 respectively. Below is a solution I found.
 * To quote the original source of the fix,
 * > “looks like javascript may not directly access someLink.href when doing string
   > matching when looping through a collection of DOM nodes. Whether this is tied
   > to your doctype or triggered by some other script, or a security change with
   > a service pack update, I’m not sure, and it’s quite weird.”
 * The Fix:
 * Replace
 * `ext = ( L.href.indexOf('?') == -1 ) ? L.href.slice(-4).toLowerCase() : L.href.
   substring( 0, L.href.indexOf('?') ).slice(-4).toLowerCase();`
 * at each location with
 * `ext = ( L.getAttribute('href').indexOf('?') == -1 ) ? L.getAttribute('href').
   slice(-4).toLowerCase() : L.getAttribute('href').substring( 0, L.getAttribute('
   href').indexOf('?') ).slice(-4).toLowerCase();`
 * Hope that helps save someone else some time!
 * [http://wordpress.org/plugins/nextgen-gallery/](http://wordpress.org/plugins/nextgen-gallery/)

The topic ‘Invalid Argument Javascript Errors – solution’ is closed to new replies.

 * ![](https://ps.w.org/nextgen-gallery/assets/icon-256x256.png?rev=2083961)
 * [Photo Gallery, Sliders, Proofing and Themes - NextGEN Gallery](https://wordpress.org/plugins/nextgen-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-gallery/reviews/)

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [L O Lawson](https://wordpress.org/support/users/l-o-lawson/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/invalid-argument-javascript-errors-solution/)
 * Status: not resolved