summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/prado
diff options
context:
space:
mode:
authorwei <>2006-09-23 06:40:38 +0000
committerwei <>2006-09-23 06:40:38 +0000
commit6fd29b65290509f55172efccaacb5f91a4a884df (patch)
tree42b15f1a71afec31812fc0961f7fe15b2e4a5dd9 /framework/Web/Javascripts/prado
parenta5467e842316daf6a8a4345740f05a9731167ce1 (diff)
Add TJsonService
Diffstat (limited to 'framework/Web/Javascripts/prado')
-rw-r--r--framework/Web/Javascripts/prado/ajax3.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/framework/Web/Javascripts/prado/ajax3.js b/framework/Web/Javascripts/prado/ajax3.js
index 43f159f4..6a20e2b5 100644
--- a/framework/Web/Javascripts/prado/ajax3.js
+++ b/framework/Web/Javascripts/prado/ajax3.js
@@ -14,6 +14,18 @@ Object.extend(Ajax.Request.prototype,
if (event == 'Complete')
{
+ if ((this.header('Content-type') || '').match(/^text\/javascript/i))
+ {
+ try
+ {
+ json = eval('(' + transport.responseText + ')');
+ }catch (e)
+ {
+ if(typeof(json) == "string")
+ json = Prado.CallbackRequest.decode(result);
+ }
+ }
+
try
{
Prado.CallbackRequest.updatePageState(this,transport);
@@ -26,8 +38,6 @@ Object.extend(Ajax.Request.prototype,
} catch (e) {
this.dispatchException(e);
}
- if ((this.header('Content-type') || '').match(/^text\/javascript/i))
- this.evalResponse();
}
try {