Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author lynton_reed

    (@lynton_reed)

    Occasionally an upload request may not complete and errors can occur, also a corrupt image file may cause an error when the back-end attempts to re-size or create a thumbnail of the image.

    Does this file always produce this error ? Is the image file corrupt ?
    Does it happen with other files or just this one ?

    Try turning off thumbnail_crop and see if that makes a difference
    i.e. add thumbnail_crop=’0′ to the upload shortcode.

    I can quote for custom modifications if you contact me by my email through wtf-fu.com and specify what you changes you would like. (Please be as specific as you can to allow me to more accurately quote.)

    similar message here: “SyntaxError: JSON Parse error: Unrecognized token ‘<‘”
    also had the “SyntaxError: Unexpected token'<‘”

    funny thing is, when I reload the page, the uploaded image does show up.

    I am getting this error to, I’ve tried the plugin on 2 wordpress sites (granted they are dev and production versions of the same site) and after uploading any kind of file it says “SyntaxError: Unexpected token <“. It seems to me that you are attempting to decode a json object which probably contains an HTML error or header of some kind?

    Here is a screen shot

    I really like this plugin. It is much nicer than any of the other File Upload plugins I could find.

    I’m going to try it on a virgin copy of WordPress to see what happens.

    OK, it works perfectly on WordPress out-of-the-box. I still get the error with all plugins disabled on the project site, so it must have something to do with the theme…

    So it seems the original designer of this website has a necessary plugin as part of the theme that starts out with <script type=’text/javascript… and can’t be easily changed because the javascript which follows is actually generated by Php. Lovely. So, I was able to fix the Unexpected Token error by placing this around the javascipt:

    if (basename($_SERVER['PHP_SELF']) != 'admin-ajax.php') {
    ?><script type='text/javascript'>
    
    blah
    
    </script><?php } ?>

    This way the javascript is not included in admin-ajax.php.

    The plugin works great now!

    Plugin Author lynton_reed

    (@lynton_reed)

    that’s great news. thanks for following up with your solution.

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

The topic ‘Error SyntaxError: Unexpected token’ is closed to new replies.