You cannot, because requests from scripts are even more limited than from html.
That paradoxical limitation is why JSONP exists.
If you just want to distribute a file, you can bundle everything into one html file with webpack or similar.
However, if you want to host it, just host it already, and you will be able to request json (at least from the same exact domain), it's just file:// that is not allowed.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You cannot, because requests from scripts are even more limited than from html.
That paradoxical limitation is why JSONP exists.
If you just want to distribute a file, you can bundle everything into one html file with webpack or similar.
However, if you want to host it, just host it already, and you will be able to request json (at least from the same exact domain), it's just
file://
that is not allowed.