当我在Internet Explorer中使用ajax提交表单而不是提交表单时,所发送的所有变量都会出现在地址栏中。任何想法如何解决这一问题?通过ajax提交表单在Internet Explorer 8中无法正常工作
这里就是出现在地址栏输入:mypage/home?v1=name&0v=0&v2=&v3=
下面的代码:
$(".submitF").live(
"submit", function() {
var fcontent = $(this).serialize();
var divs = $(this).attr("data-div");
divs = divs.split(",");
$.ajax({
type: "post",
url: "core/ajax.php",
data: "ajax=ajax&divs=" + divs + fcontent,
beforeSend: function() {
centerWin("loading");
},
complete: function() {
$("#loading").hide("fast");
},
success: function (html) {
$("#mainWin").html(html).addClass(newClass);
});
return false;
});
当然可以用。我在外面,它仍然不起作用 –