Dear Colin: I took few minutes this morning to modify my code following your suggestion,and it works,but not entirely. There is a problem in the "displayTopic" function,where and when i use the "find" method of prototype's Enumerable object,and i couldn't figure it out.Is there anything wrong with my iterator function in that "find" method?? I wrote the "displayTopic" function like this,and the iterator function as its nested function: The detail code i've pasted to pastie:http://pastie.caboo.se/ 51571[line 73] function displayTopic(topicID){ var topic; function iterator(elem){ if(topicID==null ||topicID==""){ return (elem.isDefault==true)?true:false; }else{ return (elem.id==topicID)?true:false; } }; //find method here topic=topics.find(iterator); alert(topic.id);//this's for test,it show nothing. alert("hi");//this's for test too,it show "hi" .... .... }
Sincerely bookish 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 [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 -~----------~----~----~----~------~----~------~--~---
