LoginSignup
14
14

More than 5 years have passed since last update.

jQuery.uploadで「Uncaught SyntaxError: Unexpected token <」というエラーが出たら

Posted at

before

jquery.upload-1.0.2.js
    switch (type) {
      case 'xml':
        data = parseXml(data);
        break;
      case 'json':
        data = window.eval('(' + data + ')');
        break;
    }
    return data;

after

jquery.upload-1.0.2.js
    switch (type) {
      case 'xml':
        data = parseXml(data);
        break;
      case 'json':
        // 自動挿入タグ除去
        data = data.replace(/<pre style="word-wrap: break-word; white-space: pre-wrap;">/g, '')
        data = data.replace(/<pre>/g, '')
        data = data.replace(/<\/pre>/g, '')

        data = window.eval('(' + data + ')');
        break;
    }
    return data;
14
14
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
14