开发者

Javascript history.go

I need to give user one alert after saving an item.So I am using an open script to display this alert.But when I am moving out from that page and and coming back t开发者_如何学编程hrough history.go(-1) ,again getting the alert.How to make sure that this alert comes only if I am saving the item?


If you use history,go(-1) then you are going to the page that saved the record, so it will be saving the record again.

It might work with history.go(-2) if you came from the page that shows the result, but it might not update with the saved record because the page is cached. Go on to the page that shows the result, instead of trying to find it in the history.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜