Title: Script Syntax Error: Unexpected token &amp;
Last modified: August 20, 2016

---

# Script Syntax Error: Unexpected token &

 *  [sgwatwp](https://wordpress.org/support/users/sgwatwp/)
 * (@sgwatwp)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/script-syntax-error-unexpected-token/)
 * Inspecting my admin page with chrome I see there is a script error that is showing
   up in the console. It says it’s at line 239
 *     ```
       setup = function () {
       				$('#wpadminbar').pointer(wpseo_pointer_options).pointer('open');
       									jQuery('#pointer-close').after('<a id="pointer-primary" class="button-primary">' + 'Allow tracking' + '</a>');
       					jQuery('#pointer-primary').click(function () {
       						document.location=&quot;http://mydomain.com/dev12/wp-admin/admin.php?page=wpseo_dashboard&allow_tracking=yes&nonce=36bc1a75fd&quot;;					});
       ```
   
 * ^ the last document.location line is 239. So this is happening in part of the
   wp seo script. I have no other plugins enabled. And of course, when I deactivate
   WordPress SEO the script error goes away.
    This code appears in my footer.
 * My question is, where is this being loaded from? I also had a problem with Titles&
   Metas not displaying properly, which has not been answered yet. If I knew how
   scripts were loaded with this plugin maybe I would have a good start on diagnosing
   the problem, whether it be with my theme or something in WordPress SEO.
 * [http://wordpress.org/extend/plugins/wordpress-seo/](http://wordpress.org/extend/plugins/wordpress-seo/)

Viewing 1 replies (of 1 total)

 *  [barticus](https://wordpress.org/support/users/barticus/)
 * (@barticus)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/script-syntax-error-unexpected-token/#post-3300497)
 * I believe i have found the problem, although it is not a complete work around,
   and may not be appropriate in all cases…
 * in the file /wp-content/plugins/wordpress-seo/admin/class-pointers.php:
    - change line 233 from `<?php echo esc_js( $button2_function ) ; ?>` to `<?php
      echo $button2_function ; ?>`, and similarly,
    - change line 239 from `<?php echo esc_js( $button1_function ); ?>` to `<?php
      echo $button1_function ; ?>`
 * this function changes special characters to HTML character specifiers (i.e ” 
   to “) which is what causes this.
 * Please note i havent fully tested this so i can’t say that it works everywhere
   in the admin section (which is the only place this is loaded).
 * Good Luck!

Viewing 1 replies (of 1 total)

The topic ‘Script Syntax Error: Unexpected token &’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-seo/assets/icon-256x256.gif?rev=3419908)
 * [Yoast SEO - Advanced SEO with real-time guidance and built-in AI](https://wordpress.org/plugins/wordpress-seo/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-seo/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-seo/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-seo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-seo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-seo/reviews/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [barticus](https://wordpress.org/support/users/barticus/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/script-syntax-error-unexpected-token/#post-3300497)
 * Status: not resolved