1.在iframe中页面不能跳转(案例:登陆超时问题) ,在全局页面中加入如下代码:
$(document).ready(function(){
$.ajaxSetup({
global: false,
type: "POST",
complete: function (XMLHttpRequest, textStatus) {
var data = XMLHttpRequest.responseText;
if (data == "timeout") { //这是在服务端拦截器定义的变量
if( window.top != window.self ){
window.top.location = window.location.href;
}
}
}
});
});