开发者

Javascript history.go

开发者 https://www.devze.com 2023-01-25 13:55 出处:网络
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

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

精彩评论

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

关注公众号