Access to restricted URI denied code: 1012

后端 未结 5 1790
抹茶落季
抹茶落季 2020-12-04 15:03

How do you get around this Ajax cross site scripting problem on FireFox 3?

5条回答
  •  旧时难觅i
    2020-12-04 15:22

    One more solution: if all you need is the headers, you can specify "HEAD" as the method and it won't trigger the security issue. For instance, if you just want to know if the web page exists.

    var client = new XMLHttpRequest();
    client.open("HEAD", my_url, false);
    client.send(null);
    if(client.readyState != 4 || client.status != 200) //if we failed
        alert("can't open web page");
    

提交回复
热议问题