sonoj Posted September 21, 2015 Share Posted September 21, 2015 Chrome 45.0.2454.85 on my Win7 throws an exception SyntaxError: Unexpected token , at Object.parse (native)at jsonLoadComplete: function (file, xhr) { var data = JSON.parse(xhr.responseText); // <-- HEREwhen this xhr.responseText exceeds 1MB. JSON.parse() is the function actually throws an exception. I want to know some smart way of avoiding this 1MB problem . Link to comment Share on other sites More sharing options...
rich Posted September 21, 2015 Share Posted September 21, 2015 Are you sure the problem is the file size and not an error in the json? As I'm not convinced Chrome has a hard-coded limit for a maximum json size (and if it does I doubt it's as small as 1MB). And I know for a fact Phaser can load json files larger than this, because the Creature Animation data files are several MB in size and load and parse just fine. Link to comment Share on other sites More sharing options...
sonoj Posted September 24, 2015 Author Share Posted September 24, 2015 Thanks rich, I tried the other JSON data which is larger than 1MB, and successfully parsed.At least, there's no 1MB problem. Link to comment Share on other sites More sharing options...
MichaelD Posted September 24, 2015 Share Posted September 24, 2015 If you view the .json file with chrome if there is an error it will show, or throw it in a json-lint Link to comment Share on other sites More sharing options...
Recommended Posts