Infura+web3.js Cross-domain problem

My web3.js is zip downloaded directly from github, and then unzipped to my project. After connecting the HTTP node provided by Infura, it will report some cross-domain error. Then I try to add a line of code before the request: request.withCredentials=true . However, the library path loaded by front-end js is not correct, and there is no such line of code. Is there any solution? Below is my test code and the reported error.

The following picture is js error loading of path: template/mobile/rainbow/static/dist/lib, real lib folder path of my project is: template/mobile/rainbow/static/lib, why will appear this kind of problem, please?

Looks like this is a web3js issue, one good forum for web3js questions is, or their gitter,


I’ve run across this issue with certain version of web3js running on firefox. (I’m referring to the access-control-allow-origin error) I suggest trying a different browser or downgrading your version of web3js. ( beta is the one I’ve been using, but I’ve been using it for websockets)