I am using the update_element_function to update the text in some elements. This works fine, however, if I try to update an element that is not on the page anymore, it fails silently and no further javascript statements will be executed within that same request.responseText. Is there a way to fail gracefully in this scenario and ignore the missing elements? Thanks, Tom
Bracket it with a try..catch block and leave the catch block empty... Tom Davies wrote:>I am using the update_element_function to update the text in some >elements. This works fine, however, if I try to update an element >that is not on the page anymore, it fails silently and no further >javascript statements will be executed within that same >request.responseText. Is there a way to fail gracefully in this >scenario and ignore the missing elements? > >Thanks, >Tom >_______________________________________________ >Rails-spinoffs mailing list >Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >
Thanks. That sounds like a reasonable solution. My javascript skills are apparently a bit rusty :) Would you think this behavior would be a good feature for the update_element_function to perform? Tom On 12/6/05, Douglas Forrest <dforrest-p32f3XyCuykqcZcGjlUOXw@public.gmane.org> wrote:> Bracket it with a try..catch block and leave the catch block empty... > > Tom Davies wrote: > > >I am using the update_element_function to update the text in some > >elements. This works fine, however, if I try to update an element > >that is not on the page anymore, it fails silently and no further > >javascript statements will be executed within that same > >request.responseText. Is there a way to fail gracefully in this > >scenario and ignore the missing elements? > > > >Thanks, > >Tom > >_______________________________________________ > >Rails-spinoffs mailing list > >Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > >http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >
Probably not. The way it is now is probably the way that most users would expect to be and you have complete control over the error handling... Doug Tom Davies wrote: Thanks. That sounds like a reasonable solution. My javascript skills are apparently a bit rusty :) Would you think this behavior would be a good feature for the update_element_function to perform? Tom On 12/6/05, Douglas Forrest wrote: Bracket it with a try..catch block and leave the catch block empty... Tom Davies wrote: I am using the update_element_function to update the text in some elements. This works fine, however, if I try to update an element that is not on the page anymore, it fails silently and no further javascript statements will be executed within that same request.responseText. Is there a way to fail gracefully in this scenario and ignore the missing elements? Thanks, Tom _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs