views:

68

answers:

1

I have a main page which contains a simple iframe. Iframe source = a php file. The PHP have a link the user can click, but whenever clicked, the browser history increases.

I want the iframe to be independent, without affecting history. Possible? I am not familiar with ajax btw.

PS: Its only 1 link in the iframe which can be clicked.

Thanks

+3  A: 

The only thing that comes to my mind is to use location.replace to change the URL in the iframe , when the link is clicked.

That method doesn't store the current page in the browser's session history, for example:

<a href="http://google.com"
   onclick="location.replace(this.href);return false;"/>Google</a>

Or connecting the event programmatically:

<a href="http://google.com" id="linkId">Google</a>

...

document.getElementById('linkId').onclick = function () {
  location.replace(this.href);
  return false;
};

Check an example here.

CMS
PERFECT .......................
Camran