+
Skip to content

XMLHttpRequest is not supported #148

@dortamiguel

Description

@dortamiguel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载