Closed huzhenjie closed 6 years ago
https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Access_control_CORS Local Debug use Local HTTP Server, please.
@PonyCui , you are right. If I put the html file and svga file into the same HTTP server. It works.
But, I found that if the svga file in the other host. It case...
1 Failed to load http://biuugames.huya.com/a9265981485f1130c7e7fd2f2be1252a.svga: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://admin.yaoguo.game.yy.com' is therefore not allowed access.
After reading the source code.
const req = new XMLHttpRequest()
req.open("GET", url, true);
req.responseType = "arraybuffer"
req.onloadend = () => {
actions.load_viaProto(req.response, cb, failure);
}
req.send()
Why not use the protocol such as jsoup
to load it.
How could you send ArrayBuffer as JSONP?
Problem
Your sample has a problem in
Chrome
. It case exception like this:Here is my origin html code:
I just thought that it was my mistake. Actually it works perfectly in
Safari