简体   繁体   中英

back button issue in chrome

I am facing issue with the way back button works in Chrome.

I have a application where I am displaying a form in iframe inside the parents window. So when the user clicks on back button the behavior on IE and Mozilla is that page in iFrame loads up again. This iFrame page refresh when the user clicks browser back button is important in my case is because we need to keep a track of users who have logged in the application and accessed that iFrame content.

Now in Chrome the behavior of back button is different. When the user clicks on browser back button the user is taken back to previous page.

I need to alter this behavior for chrome and need to refresh the content in iFrame instead of moving back to previous page. Anyone kindly who have idea on this help me out.

PS: I cant use jQuery in application.

Regards,

Well the short answer is you can't and you shouldn't. becoz this behavior is inconsistent across different browsers and even future versions of mozilla and ie may also change it's behavior.

Still you have some alternatives to achieve this kind of behavior. You can use HTML5's history.pushState where on hashchange event you can refresh you frame whenever you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM