4 ms·
Prototype (the Javascript library) does this automatically for AJAX responses, and Ruby on Rails makes extensive use of this facility through its RJS mechanism.
by cduan 19y ago
Prototype (the Javascript library) does this automatically for AJAX responses, and Ruby on Rails makes extensive use of this facility through its RJS mechanism.
http://www.prototypejs.org/api/ajax/request http://www.prototypejs.org/api/ajax/request
describes Prototype's functionality (scroll down to "Automatic JavaScript response evaluation"). It also provides some explanation of why it's not much of a security hole.
http://www.codyfauser.com/2005/11/20/rails-rjs-templates http://www.codyfauser.com/2005/11/20/rails-rjs-templates
describes how Ruby on Rails uses this Prototype feature.