Title: SyntaxError: Unexpected token
Last modified: August 22, 2016

---

# SyntaxError: Unexpected token

 *  [Ash](https://wordpress.org/support/users/ashmetry/)
 * (@ashmetry)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/syntaxerror-unexpected-token-5/)
 * In Developers tools I get the error “SyntaxError: Unexpected token < line 1” 
   when I visit the “Other Options” page in the admin section. It doesn’t affect
   anything on that page however it does if I try to insert a gallery in a post.
   
   Clicking the SAVE button does nothing: [http://cl.ly/image/1N3M311p022F](http://cl.ly/image/1N3M311p022F)
   and I see the error in the developer tools: [http://cl.ly/image/0j2N1R3q2G11](http://cl.ly/image/0j2N1R3q2G11)
 * I don’t believe there is a conflict with the theme since I have the same theme
   running on another install and I am not getting any problems.
 * The error does not appear if I go to “Gallery Settings” but it does on “Other
   Options” or when adding a gallery in the body of a post.
 * Is there something special in these pages that show the js error?
 * I scanned log files and I even added error_reporting(-1); in the core plugin 
   file to attempt to trouble shoot and get more details but nothing.
 * Please advise. Thanks!
 * [https://wordpress.org/plugins/nextgen-gallery/](https://wordpress.org/plugins/nextgen-gallery/)

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

 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/syntaxerror-unexpected-token-5/#post-5572721)
 * [@ash](https://wordpress.org/support/users/ash/) – Have you tried re-installing
   the plugin on that particular site? There could be a corrupted file in the installation…
 * – Cais.
 *  Thread Starter [Ash](https://wordpress.org/support/users/ashmetry/)
 * (@ashmetry)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/syntaxerror-unexpected-token-5/#post-5572722)
 * Hi Cais,
 * Yes. I’ve tried that. I’ve uninstalled, deleted, and reinstalled and the error
   remains.
 * I am wondering what’s so special about these calls? I even have CDN which I disabled
   just in case any cross domain references in css/js is causing it. but nothing…
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/syntaxerror-unexpected-token-5/#post-5572727)
 * [@ash](https://wordpress.org/support/users/ash/) – Although you do not believe
   it is the theme, have you tried deactivating *all* plugins, temporarily switching
   to a default WordPress Twenty series theme and reactivating NextGEN Gallery only?
   Does the issue still persist?
 * – Cais.
 *  Thread Starter [Ash](https://wordpress.org/support/users/ashmetry/)
 * (@ashmetry)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/syntaxerror-unexpected-token-5/#post-5572728)
 * Unfortunately that is not an option since this is a production website with 1000s
   of daily visitors. The theme is genesis based.
 * I am trying to clone the website elsewhere and do what you recommended on another
   server. Hopefully I can duplicate the issue
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/syntaxerror-unexpected-token-5/#post-5572738)
 * [@ash](https://wordpress.org/support/users/ash/) – I don’t suspect a Genesis 
   based theme to cause issues, it’s just a SOP for troubleshooting to use a default
   WordPress Twenty series theme as a baseline.
 * Let us know what you find with the clone site.
 * Thanks!
 * – Cais.
 *  Thread Starter [Ash](https://wordpress.org/support/users/ashmetry/)
 * (@ashmetry)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/syntaxerror-unexpected-token-5/#post-5572757)
 * I did more troubleshooting. The problem seems to be in the call to /photocrati_ajax,
   it seems to return extra text from the wp_footer section defined in Genesis after
   the json string being returned which causes parse error in JSON.parse(…).
 * I am still unable to duplicate the issue locally but Firefox Debugger shows it
   clearly on the production server.
 * Still troubleshooting.
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/syntaxerror-unexpected-token-5/#post-5572900)
 * [@ash](https://wordpress.org/support/users/ash/) – Thanks … we have not had trouble
   specifically with a Genesis based theme to date that I am aware of. This would
   be good to know the root cause so it can be addressed … either through NextGEN
   Gallery or through the Genesis based theme.
 * – Cais.
 *  Thread Starter [Ash](https://wordpress.org/support/users/ashmetry/)
 * (@ashmetry)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/syntaxerror-unexpected-token-5/#post-5572911)
 * I tried with another Genesis install and the problem wasn’t there (so it’s not
   Genesis’s fault).
    I was able to do more testing and for some reason the ajax
   calls executes wp_footer() and return it’s content in the json response which
   results in a malformatted json string. Something triggering that but I am not
   clear to the cause.
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/syntaxerror-unexpected-token-5/#post-5572913)
 * [@ash](https://wordpress.org/support/users/ash/) – Please let us know if you 
   find the root cause on this … as its described now I do not recall a similar 
   issue.
 * – Cais.

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

The topic ‘SyntaxError: Unexpected token’ 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](https://wordpress.org/support/topic-tag/javascript/)

 * 9 replies
 * 2 participants
 * Last reply from: [photocrati](https://wordpress.org/support/users/photocrati/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/syntaxerror-unexpected-token-5/#post-5572913)
 * Status: not resolved