Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XMLHttpRequest is not supported #148

Open
dortamiguel opened this issue Jul 23, 2016 · 0 comments
Open

XMLHttpRequest is not supported #148

dortamiguel opened this issue Jul 23, 2016 · 0 comments

Comments

@dortamiguel
Copy link

Hi, I found that the XMLHttpRequest is not working in the jxcore-cordova plugin, if you put the following code as a normal script loaded from the index.html everything is fine but if I do it inside the jxcore/app.js it fails.

var XMLHttpFactories = [
    function () {return new XMLHttpRequest()},
    function () {return new ActiveXObject("Msxml2.XMLHTTP")},
    function () {return new ActiveXObject("Msxml3.XMLHTTP")},
    function () {return new ActiveXObject("Microsoft.XMLHTTP")}
];

var xhr = null;
for (var i=0;i<XMLHttpFactories.length;i++) {
    try { xhr = XMLHttpFactories[i](); }
    catch (e) { continue; }
    break;
}
console.log(xhr);
if (!xhr) throw console.log("XMLHttpRequest is not supported");

I have the Content-Security-Policy on my index.html but I don't know where to put it inside the jxcore/app.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant