2

Here is a situation. We have a search feature which uses ajax so that search results can be updated when user changes one of the search filters. The search results page also has 3 ad units that are using iframes. We are using iframes so that when usees use pagination to go different pages or update search results using search filters, the ads can be refreshed. Now the problem is if user uses pagination to go to different pages and then try to use browser back button, it does not work properly because when you change iframe source, browser add this in history

I would apprecaite any help on how to solve this issue.

RH.
  • 19
  • 3

2 Answers2

0

You may want to consider loading ads dynamically (i.e. AJAX), instead of using iframes. So, you would simply use a <div> to display the ad (loaded with AJAX) instead of an <iframe>.

William Niu
  • 15,798
  • 7
  • 53
  • 93
  • The ads are being served by Google Ad Manager, which currently shows adsense ads. Will using div work with adsense in this case? – RH. Dec 14 '10 at 02:13
  • Are you currently using AdSense for Ajax (http://code.google.com/apis/afa/)? I think it is the answer you're after, as proposed in this post: http://stackoverflow.com/questions/435391/refresh-a-div-that-has-a-google-ad-inside-it#441425 – William Niu Dec 14 '10 at 03:23
  • We have already applied for Adsense for Ajax, but don't know if and when we will be give access to it. Has anyone got access to it? – RH. Dec 14 '10 at 04:13
0

Mayby try location.replace("http://yourPage...") to replace the browsers last history entry after iFrame load?

Ilyssis
  • 4,849
  • 7
  • 24
  • 30
  • The replace method loads the specified URL over the current history entry. After calling the replace method, the user cannot navigate to the previous URL by using browser's Back button. – RH. Dec 14 '10 at 02:14
  • >because when you change iframe source, browser add this in history< I thought you could overwrite the iframe history entry this way... well, maybe not. – Ilyssis Dec 14 '10 at 08:06