Iframe back button problem (do not want the return button to affect iframe)

I have a pretty simple problem that I could not fix on my own (I am having problems managing the iframe).

Basically, go to say this page ....

http://andrew.koallo.ca/new/393NelsonSt-JordanFisher

click "Click here to map" ... and the map should load for you ... now if you back one time ... it will only return iframe .... so basically you have double click "Back "to return to the original page.

Can this be avoided? ... After clicking the "Click here to go to map" button, I set src iframe to be equal to the corresponding source ....

I read that maybe location.replace can help? failed to get it to work.

Thanks for any help, Andrew

+3
source share
2 answers

the page you specified is offline atm, but you need to set the url for the iframe as follows:

$('#myIframe').get(0).contentWindow.location.replace('http://...'); 

to prevent the URL from getting into your browsing history.

+6
source

Either put the "back" button on the page with the onclick event in the referrer, or change the iframe code to use only Ajax calls.

0
source

Source: https://habr.com/ru/post/1707043/


All Articles