Skip to content

Commit 726e5b1

Browse files
authored
Merge pull request #3686 from limzykenneth/jsonp-fix
Fix loadJSON() usage with JSONP
2 parents e29ce17 + d10555d commit 726e5b1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/io/files.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,10 @@ p5.prototype.httpDo = function() {
11411141
err.ok = false;
11421142
throw err;
11431143
} else {
1144-
var fileSize = res.headers.get('content-length');
1144+
var fileSize = 0;
1145+
if (type !== 'jsonp') {
1146+
fileSize = res.headers.get('content-length');
1147+
}
11451148
if (fileSize && fileSize > 64000000) {
11461149
p5._friendlyFileLoadError(7, path);
11471150
}

0 commit comments

Comments
 (0)