I am currently working on a site/application that is ajax driven. As it stands right now it works properly, and degrades properly as well. One issue I am having is history. I tried klaus's history plugin, and it works great except one small problem, several of my links that are loaded by the the ajax call. It is a little confusing, so hopfully a tree diagram helps :s
#home --always in dom #forum --always in dom #Topic1 --only inserted into dom via ajax, same with the following forum links #thread1 #post1 #thread2 #Topic2 #downloads --always in dom So in short, a user clicks #forums, the topics are displayed. A user clicks #topic1, all the threads are displayed. A user clicks #thread1, and so on. So when a user is in the #thread1, they click back the url changes to #Topic1, but the content doesnt change, they click back again the url changes to #forum, and the inner content does change to show all the topics. I am assuming that this happens because the #forum link is in the dom, and has a proper href to follow. So I was thinking some type of iframe history would do the trick, after some searching, there isnt a plugin for jquery that does this specifically for all browsers. But I did find this http://www.dhtmlnirvana.com/program/permalink/ajax_history.html Now I believe I have all my ducks in a row. I have a div that is hidden, and one that is not. I am using the same iframe to pull data through, so it has the same name and id. For my ajax call I am retrieving that iframe, with the src pointing to my desired page. The <a> tags have the target attribute set to the id of the iframe. The hidden div which is suppose to be updated with the iframe via a ajax call is, but since the <a> has the target set to the iframe id it should push the data to the displayed div, with the same iframe. But it is not. I really dont have an idea of why this isnt working. Im guessing it has something to do with how jquery is inserting the html into the dom, but im not to sure. So really my question is, which method is best for the application I am making, and if anybody has tips on how to get either of the two to work properly, or if there is better method which I havnt found. Another thing that is confusing me is that this isnt a bigger issue I mean with the popularity of ajax driving web applications, and the fact that a lot of links could possibly be nested similar to my structure, yet I havnt been able to find a elegant solution. Either that or I am looking at this the wrong way and making it harder then it has to be. If you need more information, let me know so I can get this figured out as soon as possible, I know there is a few other people with a similar situation, as I've seen this ased on the irc chan a few times, maybe not as long or detailed tho ;) Cheers Des