X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775..10a866c12701c0a0afd0ac85dcdcf32a421514ac:/docs/source/ScriptTagProxy.html diff --git a/docs/source/ScriptTagProxy.html b/docs/source/ScriptTagProxy.html index 21c05c92..c2e1f3df 100644 --- a/docs/source/ScriptTagProxy.html +++ b/docs/source/ScriptTagProxy.html @@ -1,17 +1,12 @@ - - - The source code - - - - -
/*!
- * Ext JS Library 3.0.3
- * Copyright(c) 2006-2009 Ext JS, LLC
- * licensing@extjs.com
- * http://www.extjs.com/license
- */
-
/** + + + + The source code + + + + +
/** * @class Ext.data.ScriptTagProxy * @extends Ext.data.DataProxy * An implementation of Ext.data.DataProxy that reads a data object from a URL which may be in a domain @@ -45,6 +40,21 @@ out.print(dataBlock.toJsonString()); if (scriptTag) { out.write(");"); } +
+ *

Below is a PHP example to do the same thing:


+$callback = $_REQUEST['callback'];
+
+// Create the output object.
+$output = array('a' => 'Apple', 'b' => 'Banana');
+
+//start output
+if ($callback) {
+    header('Content-Type: text/javascript');
+    echo $callback . '(' . json_encode($output) . ');';
+} else {
+    header('Content-Type: application/x-json');
+    echo json_encode($output);
+}
 
* * @constructor @@ -115,7 +125,7 @@ Ext.extend(Ext.data.ScriptTagProxy, Ext.data.DataProxy, { *
  • The "arg" argument from the load function
  • *
  • A boolean success indicator
  • * - * @param {Object} scope The scope in which to call the callback + * @param {Object} scope The scope (this reference) in which the callback function is executed. Defaults to the browser window. * @param {Object} arg An optional argument which is passed to the callback as its second parameter. */ doRequest : function(action, rs, params, reader, callback, scope, arg) { @@ -173,12 +183,12 @@ Ext.extend(Ext.data.ScriptTagProxy, Ext.data.DataProxy, { } }; }, - /** +
    /** * Callback for read actions * @param {String} action [Ext.data.Api.actions.create|read|update|destroy] * @param {Object} trans The request transaction object * @param {Object} res The server response - * @private + * @protected */ onRead : function(action, trans, res) { var result; @@ -202,12 +212,12 @@ Ext.extend(Ext.data.ScriptTagProxy, Ext.data.DataProxy, { } trans.callback.call(trans.scope||window, result, trans.arg, result.success); }, - /** +
    /** * Callback for write actions * @param {String} action [Ext.data.Api.actions.create|read|update|destroy] * @param {Object} trans The request transaction object * @param {Object} res The server response - * @private + * @protected */ onWrite : function(action, trans, response, rs) { var reader = trans.reader; @@ -283,6 +293,6 @@ Ext.extend(Ext.data.ScriptTagProxy, Ext.data.DataProxy, { this.abort(); Ext.data.ScriptTagProxy.superclass.destroy.call(this); } -});
    - +}); + \ No newline at end of file