tec*_*ude 6 ajax jquery post internet-explorer internet-explorer-10
好吧,我研究了几个小时,我仍然难过.
Internet Explorer 10将使用jquery提交ajax请求,但不包括发布数据.
这是代码:
var ajaxData = "FirstName="+encodeURIComponent($('#FirstName').val()); //get the data from the account form
ajaxData += "&LastName="+encodeURIComponent($('#LastName').val());
ajaxData += "&EmailAddress="+encodeURIComponent($('#EmailAddress').val());
ajaxData += "&CAT_Custom_246311="+encodeURIComponent(listData);
var config = {
async: false,
type: "POST",
url: "/FormProcessv2.aspx?WebFormID=44714&OID={module_oid}&OTYPE={module_otype}&EID={module_eid}&CID={module_cid}&JSON=1",
dataType: "json", // text"json",
processData: false,
data: ajaxData,
timeout: 70000,
cache: false,
};
$.ajax(config)
.done(function(data, event) {
if(data.FormProcessV2Response.success == true){ //success field is in BC response
alert("The list was submitted sucessfully.");
console.log(XHR);
} else{
alert("An error occurred and the list was not submitted.");
}
})
.fail(function(msg,event) {
alert("An error occurred and the list was not submitted.");
});
Run Code Online (Sandbox Code Playgroud)
每个其他浏览器(safari,opera,chrome,firefox,IE9)都可以使用它,但代码在IE 10中失败.使用fiddler查看它显示其他浏览器和IE 10之间的标题几乎相同,但是IE 10的请求标头的内容长度值为0,并且没有正文文本.
参考人们一直遇到的其他一些问题,不,我没有任何下载管理器样式的插件.所有插件都是默认的.这是我用于记录的插件的照片.

var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("POST",config.url,true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send(config.data);
}
Run Code Online (Sandbox Code Playgroud)
这是来自w3schools的原始请求的虚拟文本,带有我自己的数据.
以下是Internet Explorer本身提供的数据值的示例(使用开发工具)
FirstName=Joe&LastName=Spacely&EmailAddress=tester%40test.com&CAT_Custom_246311=test%3Dtest
Run Code Online (Sandbox Code Playgroud)
我在Windows 8 x64 w/Media Pack上使用Internet Explorer 10.0.9200.16519.
Internet Explorer根本不支持它吗?
任何帮助,将不胜感激.哦,请不要告诉我IE有多糟糕.我们都知道,但我们网络开发人员仍然需要处理它.
按要求发布:
这是否与您的 URL 上已有 $_POST 数据有关?如果您在变量中包含该信息并且只有静态 URL,也许会取得更大的成功。
顺便说一句,您可能会考虑使用 {key:value} 对,因为构建查询字符串更难以维护。
| 归档时间: |
|
| 查看次数: |
6725 次 |
| 最近记录: |