Maybe it''s a common problem for ajaxors,if your page is basing on ajax,that means parts of the page''s contents are dynamically generated through the response of your ajax request. In this case ,if your do not do something to deal with the page''s state,when refreshing the page,it will go back to its initial state,which means that the generated contents are missing... On the other hand,the same problem happens when you bookmark the ajax page ;. Here,please Allow me to call the two problems above "Navigation state problem" of ajax. So,is there any Good solution to settle the "Navigation state problem"? Using window.location.hash to record the actions on the ajax page may work?But are there some doc about this?I need your help guys. Or, what is your good opinion? Sincerely, Punk.Vin. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2007-Mar-28 07:31 UTC
Re: How2Do?settling Ajax pages'' refreshing or bookmarking problem?
Hey Vin, Well, there are "transient pages," which you should not have to bmk... And pages that should be bmkable (or refreshable, for that matter). The issue has been discussed countless times already, although not quite on this list, as it is a non-Spinoffs-specific thing. Pulled from my archives, here are a few links that might be of interest to you, pertaining to AJAX accessibility and ergonomy in general: http://www.contentwithstyle.co.uk/Articles/38 (Back button) http://adactio.com/journal/959 http://particletree.com/features/the-hows-and-whys-of-degradable-ajax/ http://particletree.com/features/degradable-ajax-form-validation/ http://www.baekdal.com/articles/usability/usable-XMLHttpRequest/ The way I see it, the "best" (although a bit unsatisfactory) way is to provide clear, standing-out "Refresh" links (e.g. eBay on bid pads) and "Bookmark this!" links (e.g. Google Maps on specific views) ; so your server side has a URL (de)serialization mechanism in place that can encode a transient state and use the resulting URL to restore it later. ''HTH -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Vin
2007-Mar-28 08:47 UTC
Re: How2Do?settling Ajax pages'' refreshing or bookmarking problem?
You are so kind-heated:->Thx. I will read your doc tonight to get some points! BTW:I saw someone using window.location.hash arguments to deal with the refreshing problem,here some sample RefreshHandler.js(a class in fact) code below,how do you think of this method?Is it good? //parsing hash to figure out pages'' current state,and then invoke corresponding javascript function again to recover pages'' //state. var RefreshHandler=Class.create(); RefreshHandler.prototype={ initialize:function(){ this.keyValue=new function(){}; }, check:function(s){ var hash=window.location.hash; hash=hash.substring(1,hash.length); var arr=hash.split(''#'')[0].split(''/''); var keyValue=new Object(); for(var i=0;i<arr.length;i++){ keyValue[arr[i].split(''.'')[0]]=arr[i].split(''.'')[1]; } if(s && !keyValue[s])return false; if(s && keyValue[s]){ if(s=="adminAction"){ eval("adminHandler.show(''"+keyValue[s]+"'');"); }else{ eval(keyValue[s]+"();"); } return true; } if(keyValue.tid){gsb(keyValue.tid);return true;} if(keyValue.sid=="0"){ if(keyValue.page && keyValue.page!="1"){ getBlog("0",keyValue.page); return true; } } if(keyValue.sid && keyValue.sid!="0") {getBlog(keyValue.sid,keyValue.page?keyValue.page:1);return true;} return false; }, toHash:function(){ var hh="#"; for(var p in this.keyValue){ if(p=="extend")continue; if(this.keyValue[p] || this.keyValue[p]=="0"){ hh+=p+"."+this.keyValue[p]+"/"; } } window.location="http://"+window.location.host.split(''/'') [0]+window.location.pathname+window.location.search+hh; }, setValue:function(key,value){ this.keyValue[key]=value; }, reset:function(){ this.keyValue=new function(){}; } } And the website using this RefreshHandler.js is :http:// www.x2blog.cn,you can view http://www.x2blog.cn/incubus convenient. On 3月28日, 下午3时31分, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> Hey Vin, > > Well, there are "transient pages," which you should not have to bmk... > And pages that should be bmkable (or refreshable, for that matter). > > The issue has been discussed countless times already, although not quite > on this list, as it is a non-Spinoffs-specific thing. > > Pulled from my archives, here are a few links that might be of interest > to you, pertaining to AJAX accessibility and ergonomy in general: > > http://www.contentwithstyle.co.uk/Articles/38(Back button) > http://adactio.com/journal/959 > http://particletree.com/features/the-hows-and-whys-of-degradable-ajax/ > http://particletree.com/features/degradable-ajax-form-validation/ > http://www.baekdal.com/articles/usability/usable-XMLHttpRequest/ > > The way I see it, the "best" (although a bit unsatisfactory) way is to > provide clear, standing-out "Refresh" links (e.g. eBay on bid pads) and > "Bookmark this!" links (e.g. Google Maps on specific views) ; so your > server side has a URL (de)serialization mechanism in place that can > encode a transient state and use the resulting URL to restore it later. > > ''HTH > > -- > Christophe Porteneuve a.k.a. TDD > "[They] did not know it was impossible, so they did it." --Mark Twain > Email: t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Dave Crane
2007-Mar-29 08:44 UTC
Re: How2Do?settling Ajax pages'' refreshing or bookmarking problem?
On Wednesday 28 March 2007 08:31, Christophe Porteneuve wrote:> Hey Vin, > > > Pulled from my archives, here are a few links that might be of interest > to you, pertaining to AJAX accessibility and ergonomy in general: > > http://www.contentwithstyle.co.uk/Articles/38 (Back button) > http://adactio.com/journal/959 > http://particletree.com/features/the-hows-and-whys-of-degradable-ajax/ > http://particletree.com/features/degradable-ajax-form-validation/ > http://www.baekdal.com/articles/usability/usable-XMLHttpRequest/ >If you want an out-of-the-box solution, Brad Neuberg''s Really Simple History (http://codinginparadise.org/projects/dhtml_history/README.html) uses the techniques described here to work with bookmarking and the back button. It''s fairly straightforward to use, and lets you store an arbitrary amount of state alongside each history entry. I just noticed in the README that he says ''Safari is not supported''. Anyone know if Safari has generic issues with these techniques, or is it just that Mr. Neuberg doesn''t have a Mac? Dave -- ---------------------- Author Ajax in Action http://manning.com/crane Ajax in Practice http://manning.com/crane2 Prototype & Scriptaculous in Action http://manning.com/crane3 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Maninder, Singh
2007-Mar-29 12:13 UTC
Re: How2Do?settling Ajax pages'' refreshing or bookmarking problem?
Issues that Brad faced wrt Safari: http://codinginparadise.org/weblog/2005/08/ajax-notes-on-detecting-history.html Resolutions: http://bloomd.home.mchsi.com/histapi/test.html http://www.unfocus.com/projects/HistoryKeeper/ Thanks, Mandy. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Vin
2007-Mar-30 04:02 UTC
Re: How2Do?settling Ajax pages'' refreshing or bookmarking problem?
Thanks all you guys!:> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---