Skip to content

Commit

Permalink
Merge pull request #1 from kdepp/master
Browse files Browse the repository at this point in the history
fix cs: get config.json
  • Loading branch information
A9T9 committed Jan 26, 2018
2 parents 66f4abe + 928acfd commit 1cbce85
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/cs.js
Expand Up @@ -346,7 +346,8 @@
)
.done(function (config, htmlStr) {
HTMLSTRCOPY = htmlStr[0];
OCRTranslator.APPCONFIG = APPCONFIG = JSON.parse(config[0]);
// Note: it seems like with jQuery 3+, $.get (ajax) directly returns a json object if you're loading a json file
OCRTranslator.APPCONFIG = APPCONFIG = typeof config[0] === 'string' ? JSON.parse(config[0]) : config[0];
$dfd.resolve(APPCONFIG, HTMLSTRCOPY);
})
.fail(function (err) {
Expand Down

0 comments on commit 1cbce85

Please sign in to comment.