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, https://forum.ethereum.org/categories/ethereum-js or their gitter, https://gitter.im/ethereum/web3.js?source=orgpage

Hello,

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. (1.0.0.33 beta is the one I’ve been using, but I’ve been using it for websockets)