IE8 ajax传输和跳转 layer

需要注意的几个点,异步/跨域/成功后跳转
JQ 2.0以下,layer版本为2.4
异步:async: false,
跨域:jQuery.support.cors = true;
layer刷新父页面:parent.location.href
```
$("#form-admin-add").submit(function (e) {
jQuery.support.cors = true;
$.ajax({
type: "post",
url: "{:url('Admin/add',['time'=>rand(0,999999)])}",
data: $('#form-admin-add').serialize(),//表单数据
dataType: "JSON",
cache: false,
async: false,

success: function (data) {
if (data.status == 1) {
layer.msg('操作成功!', {
time: 1000,
icon: 1
})
parent.location.href = "{:url('Admin/index')}";
} else {
layer.msg('操作失败!', {
time: 1000,
icon: 2
})
}
;
},
error: function (data) {
alert("异常!");
}

});
});
```

点赞