0

在 IE 8 及更高版本中,它需要刷新页面才能显示成功数据。在其他浏览器中,此功能正常工作但在 IE 中查看更新的数据需要重新加载页面

代码:

$('#ajaxEmpData').on('submit', function (e) {

        if (e.preventDefault) {
            e.preventDefault();
        } else {
            e.returnValue = true;
        }
        $.ajax({
            type: 'post',
            url: '/candidate/emp',
            data: $('#ajaxEmpData').serialize(),
            error:function(request,status,error) { 
                alert(status); 
                document.getElementById('load').style.visibility = "hidden";
            },
            beforeSend:function(){
                document.getElementById('load').style.visibility = "visible";

            },       
            success: function (data) {
                $('body').html(data);   
                }
        });

    });
4

1 回答 1

0

new Event(event).preventDefault();

通过此代码运行正常

于 2013-07-24T13:11:11.213 回答