Is there any reason for the eval to be called after the callbacks for
onSuccess onFailure,
I have the following which just moves the eval above, so the response
is evaled ready for use in the onSuccess onFailure callbacks.
Index: otb_on_rails/public/javascripts/prototype.js
===================================================================
--- otb_on_rails/public/javascripts/prototype.js (revision 4999)
+++ otb_on_rails/public/javascripts/prototype.js (working copy)
@@ -1287,6 +1287,13 @@
var state = Ajax.Request.Events[readyState], response = new
Ajax.Response(this);
if (state == 'Complete') {
+
+ var contentType = response.getHeader('Content-type');
+ if (this.options.evalJS == 'force'
+ || (this.options.evalJS && contentType
+ && contentType.match(/^\s*(text|application)\/(x-)?(java|
ecma)script(;.*)?\s*$/i)))
+ this.evalResponse();
+
try {
this._complete = true;
(this.options['on' + response.status]
@@ -1294,13 +1301,7 @@
|| Prototype.emptyFunction)(response, response.headerJSON);
} catch (e) {
this.dispatchException(e);
- }
-
- var contentType = response.getHeader('Content-type');
- if (this.options.evalJS == 'force'
- || (this.options.evalJS && contentType
- && contentType.match(/^\s*(text|application)\/(x-)?(java|
ecma)script(;.*)?\s*$/i)))
- this.evalResponse();
+ }
}
try {
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" 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/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---