English 中文(简体)
我们能够在目前使用的超文本页面卸载功能中查阅浏览器的次申请。
原标题:Can we access the URL of next request of browser in prevailing HTML page s unload function

由于Html代码在新卢尔要求答复之前就一直存在。 然后Browser在卸载和卸载之前打电话。

这意味着,在浏览器的任何地方,该圆顶是因卸载而遭到袭击的。 因此,我们能够在卸载功能中找到(新的)URL吗?

实际 我的设想是,如果用户只打了另一个与我们领域相似的URL,表明他想从我们的现场走出去,那么我就希望打开大门,提供其他选择。

最佳回答

无——你没有机会这样做。 你的can的确把点击事件trap到所有因素之中,这些要素将使你离开网页,然后将URL储存在一个全球变量中。 届时,你将具备这一价值“上载”。

这显然只与你网页上的内容合作。 如果用户将URL带入地址条码,那么你就没有这样做了。

问题回答

无,这将是严重的安全泄漏。

您可以随身随您的表格和链接,以便了解用户是否通过使用其中一人离开网页。 您可以指出,用户是否会通过书记在网站上进入另一页,打上URL,点击背等等。

Make a global JS value something like var supressPopup = false;

然后,使你的所有外部链接也包含一种方法,将这种ool光带到true(参看javascript:supressPopup=true; 所在地.href=Newurl.html(这是这样做的一种明显方式),但仅举一个例子,你可以使用一个能够扫描所有网页<a>的标签,并在Click活动上添加一个字,如果

Then, in your unload code, check for supressPopup; if it is false, show your popup.





相关问题
selected text in iframe

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.

How to fire event handlers on the link using javascript

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 ...

How to Add script codes before the </body> tag ASP.NET

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 ...

Clipboard access using Javascript - sans Flash?

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 ...

javascript debugging question

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 ...

Parsing date like twitter

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.

热门标签