I just noticed that if loadJSON() fails due to e.g. a CORS error, the user isn't informed in any way. They should be!
This might actually involve making changes to p5.js itself, or monkeypatching p5 at runtime to behave differently. Looking at the source code, it appears loadJSON just logs the XHR's statusText on failure if an error occurs and an explicit error callback wasn't provided to loadJSON--and in Chrome's case at least, statusText is just an empty string!
I just noticed that if
loadJSON()
fails due to e.g. a CORS error, the user isn't informed in any way. They should be!This might actually involve making changes to p5.js itself, or monkeypatching p5 at runtime to behave differently. Looking at the source code, it appears
loadJSON
just logs the XHR'sstatusText
on failure if an error occurs and an explicit error callback wasn't provided toloadJSON
--and in Chrome's case at least,statusText
is just an empty string!