Andrew
Andrew

Reputation: 3670

iframe back button problem (don't want back button to affect iframe)

I have a pretty simple problem which I have not been able to fix myself (I am having trouble manipulating iframes).

Basically, go to say this page....

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

click on "Click here to Map"...and a map should load up for you....now if you his back once...it will only take back the iframe....so basically you have to hit the back button twice to return to your original page.

Is it possible to avoid this?...Upon clicking the "Click here to Map" button I set the src of the iframe equal to the respective source....

I was reading that perhaps location.replace can help? have no been able to get it working.

Thanks for any help, Andrew

Upvotes: 6

Views: 7602

Answers (2)

schellmax
schellmax

Reputation: 6094

the page you mentioned is offline atm, but you need to set the url for the iframe like this:

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

so the url won't make it into the browsers history.

Upvotes: 7

Anonymous
Anonymous

Reputation:

Either put a "back" button in the page with an onclick event to the referrer or change the iframe's code to only use Ajax calls.

Upvotes: 0

Related Questions