文档详情

onbeforeunload与a标签在IE中的冲突bug(国外英文资料).doc

发布:2017-06-05约7.65千字共14页下载文档
文本预览下载声明
onbeforeunload与a标签在IE中的冲突bug(国外英文资料) Onbeforeunload is the window of an event, the current Firefox, IE all support, is mainly used to prompt the user whether to leave the page, usually in some of the more important data before submitting, prevent users from wrong operation cause data loss. Typical applications such as gmail, when writing an email, will be prompted if you refresh the page or close the page. But clicking on a TAB in IE will also trigger onbeforeunload events. And the href writes javascript: void (0) doesnt work, and it wont happen in Firefox. So the information was reintroduced to the onbeforeunload event: A tag triggers the sequence of events The running relationship between onclick, onbeforeunload and href is this: onclick onbeforeunload href, and we can stop onbeforeunload by some means. In the Internet explorer browser, the onbeforeunload event is not triggered if the href is #. How to prevent onbeforeunload At the same time as Ajax, add an onclick event to a tag, so onclick runs before onbeforeunload and then return false Bypass onbeforeunload href directly In conjunction with the onclick event, we can bypass the onbeforeunload direct href, and the following code can bypass the onbeforeunload and execute the href: Var a = 1; Window. Onbeforeunload = function () { If (a) alert ( onbeforeunload event broke out! ) } As long as we add a = 0 in the onclick event Ok ~ Image rotation code with digital button switch New visitors XKER.COM time: 2010-06-25:1 Through the new website editing test, you can use it normally, very good code. The code is shown below (the code is saved to the page) : TABLE width = height = 135 border = 0 cellPadding = 0 cellSpacing = 0, The TBODY TR TD The STYLE type = text/CSS # imgTitle { FILTER: ALPHA (opacity = 70); LEFT: - 5 px; OVERFLOW: hidden; POSITION: relative; The TEXT - ALIGN: left } # imgTitle_up { LEFT: 0 px; HEIGHT: 1 px; The TEXT - ALIGN: left } # imgTitle_down { LEFT: 0 px; The TEXT - ALIGN: right } . I
显示全部
相似文档