我想将请求参数发送到其他域
我已经知道Cross Scripting需要JsonP,我已经将JsonP与Jquery ajax一起使用了
但我不知道如何使用XMLHttpRequest进行Cross Scripting
下面的代码我的基本XMLHttpRequest代码.
我想我需要chage xhr.setRequestHeader(),我必须添加解析代码
请给我任何想法
var xhr;
function createXMLHttpRequest(){
if(window.AtiveXObject){
xhr = new ActiveXObject("Microsoft.XMLHTTP");
}else{
xhr = new XMLHttpRequest();
}
var url = "http://www.helloword.com";
}
function openRequest(){
createXMLHttpRequest();
xhr.onreadystatechange = getdata;
xhr.open("POST",url,true);
xhr.setRequestHeader("Content-Type",'application/x-www-form-urlencoded');
xhr.send(data);
}
function getdata(){
if(xhr.readyState==4){
if(xhr.status==200){
var txt = xhr.responseText;
alert(txt);
}
}
}
Run Code Online (Sandbox Code Playgroud) 我的客户希望我修复My Web App的Web App漏洞,这是关于My Web App漏洞的消息
Anti-MIME-Sniffing标头X-Content-Type-Options未设置为'nosniff'
此检查特定于Internet Explorer 8和Google Chrome.如果Content-Type标头未知,请确保每个页面设置> Content-Type标头和X-CONTENT-TYPE-OPTIONS
虽然我已经找到了解决这个问题的方法,但我正在寻找tomcat配置的解决方案.是否可以对tomcat配置进行更改以实现此目的?
请给我任何想法.
ajax ×1
html5 ×1
httpresponse ×1
java ×1
javascript ×1
jsonp ×1
mime-types ×1
security ×1
tomcat ×1