首先,V3基本上使用jq 2+版本,如果要兼容IE需要相应降低jQuery的版本引入。如果想在用户登录之后,点击注销退出,且兼容IE,尤其是IE 8,需要对原标签和文件进行修改!
1. 修改注销的DIV标签为A链接,便于添加JS onclick触发事件,如下:
<a href="javascript:void(0);" id="logout" event-node="logout" onclick="bindLogout();" style="cursor:pointer;">
2. 修改core.js文件中的bindLogout函数:
$.get(U('Ucenter/System/logout'), function (msg) {
$('body').append(msg.html);
toast.success(msg.message);
setTimeout(function () {
location.href = msg.url;
}, 2500);
}, 'json');
toast.destroy();关键是添加一个消灭消息的机制。其它就可以自由发挥了!