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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---