I have to do some kind of operation on the page refresh or reload. that is when I hit next page or Filter or refresh on the grid. I need to show some confirmation box over this Events.
是否有任何事件可以告诉你哪一页是作案手? 复读或读? 使用javascript?
成就
I have to do some kind of operation on the page refresh or reload. that is when I hit next page or Filter or refresh on the grid. I need to show some confirmation box over this Events.
是否有任何事件可以告诉你哪一页是作案手? 复读或读? 使用javascript?
成就
如果是复读(或者用户正在离开网站/张贴浏览器),window.onunload
将火灾。
// From MDN
window.onunload = unloadPage;
function unloadPage()
{
alert("unload event detected!");
}
https://developer.mozilla.org/en/DOM/window.onunload
如果你只想一个确认箱,允许他们停留,则使用:
window.onbeforeunload = function() {
return "Are you sure you want to navigate away?";
}
你们可以建立一个隐蔽的领域,将其价值放在第一页的负荷上。 当该网页再次装上时,你可以检查隐藏的现场。 如果该网页空洞,则该网页第一次装满,否则就会重新启用。 比如:
<body onLoad="CheckPageLoad();">
<input type="hidden" name="visit" id="visit" value="" />
</body>
function CheckPageLoad() {
if (document.getElementById("visit").value == "") {
// This is a fresh page load
document.getElementById("visit").value = "1";
}
else {
// This is a page refresh
}
}
我认为这是关键的。
First, the refresh/hidden field system works on the beginning of the new page copy and after, not on leaving the first page copy.
从我对这种方法和其他一些方法的研究来看,主要由于隐私标准,在卸载或更早时无法发现一页的复读。 只是在新网页装满后。
我也提出了类似的问题要求,但基本上是在停机坪上结束会议,在考虑这一问题的同时,发现浏览器将重载/重装作为两个不同的部分:
这些情况也是在这个秩序中发生的。 只有一种习俗或非标准浏览器才能不同行事。
$(function () {
if (performance.navigation.type == 1) {
yourFunction();
}
});
更多有关PerformanceNavigation。 标 标 题
How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.
I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...
Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...
Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...
I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...
Is it possible for someone to give me a few pointers on how to display a multidimensional array in the form of a bar graph? The array is multidimensional, with three elements in each part - and the ...
Is it possible to reload a form after file-input change? I have a form where the user can chose an image for upload. I also have a php script which displays that image resized. I only wonder if it ...
I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.