views:

113

answers:

1

Hi.

I was searching for a way to implement back button in an ajax application (nothing unusual) as there are plenty of articles that cover this topic.

But...

But of course there are many restrictions. So my problem that is still not solved is regarding back button in IE6,7. More specifically it is regarding back button when you display information (let say links) from one domain into another and you can control the server side of the second one only.

Here are some more details:

I have a website that has information in its database. Then the user (registered one) can copy a javascript code and paste it in his own website. The javascript then requests information from my website and displays it on the user's site (this data contains images, links, text, etc...).

When the user clicks on some of the links the script changes the url fragment identifier (document.hash) so that all states of the website are bookmarkable and you can use back and forward buttons.

This is great and workds in most of the new browsers, but does not in IE6, 7

The main problem is that the solution with iframe fix for IE6,7 doesn't work in crossdomain situation, because you can not write into the iframe.

OK, this is the problem I am thinking on recently. Someone else want to join?

PS: I tried having two iframes - one writes into the other (they are from the same domain).

A: 

Take a look at easyXDM, it will allow you to communicate freely between the code your users pastes in, and the code in the iframe. Just check out this example http://consumer.easyxdm.net/current/example/methods.html

This library does not need to change the hash fragment in any 'modern' browser (inluding ie6/7) so it will not create history points - for this I recommend using a proper history library.

Sean Kinsey
Thanks for your help Sean, but having unique URLs that identifies the current state of the app is mandatory. The question is how to create history points for IE6,7 with cross-domain communication in order back and forward to work.
miro
Thats why I recommended using a history manager :) Take a look at http://weblogs.asp.net/bleroy/archive/2007/09/07/how-to-build-a-cross-browser-history-management-system.aspxThese all work by placing a hidden iframe that is updated, and will fire events when navigated
Sean Kinsey
Thanks again Sean, I read that article a week ago, but it doesn't provide solution for cross domain back button. So I can not update the iframe once I am on the other domain.
miro
Thats what easyXDM is for - you need to combine :)
Sean Kinsey