English 中文(简体)
Jquery/javascript 检测和捕捉网页更新活动?
原标题:Jquery/javascript detect and capture page refresh events?

我有一个AJAXed网页,但我也向用户提出质询,以便他/她可以在座标中打上,再次看到同一页。 (Think googlemap and its “commlink” norm)。

当AJAX提出请求时,我更新了向用户提出的询问,但实际的URL并没有改变。 问题在于,如果用户重新启用该网页,美国宇宙航空研究开发机构创建的所有DOM要素就会消失。

我想要做的是,用黑手法报道复习活动,而不是更新网页,把用户转至网页,加插问。

比如:?data=blah&stuff=bleh

然后,不将网页重新贴在www.example.com上,复读将引导用户浏览www.example.com/?data=blah&stuff=bleh

最佳回答

如果浏览器没有实际离开网页和打上新的一页(杀害AJAX点)。

http://www.example.com/#data=blah&stuff=bleh

在您的发言稿中,例如:

window.location.hash = "data=blah$stuff=bleh";

当您的网页负荷时,你需要实际使用“散射”......例如:将它作为数据参数,来做你以前发出的同样的“宇宙航空研究开发机构”呼吁。

问题回答

暂无回答




相关问题
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.