X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775..10a866c12701c0a0afd0ac85dcdcf32a421514ac:/docs/output/Ext.data.ScriptTagProxy.html diff --git a/docs/output/Ext.data.ScriptTagProxy.html b/docs/output/Ext.data.ScriptTagProxy.html index e6554590..da235334 100644 --- a/docs/output/Ext.data.ScriptTagProxy.html +++ b/docs/output/Ext.data.ScriptTagProxy.html @@ -1,4 +1,4 @@ -
Properties Methods Events Config Options Direct Link
Observable
  DataProxy
    ScriptTagProxy

Class Ext.data.ScriptTagProxy

Package:Ext.data
Defined In:ScriptTagProxy.js
Class:ScriptTagProxy
Extends:DataProxy
An implementation of Ext.data.DataProxy that reads a data object from a URL which may be in a domain +
Observable
  DataProxy
    ScriptTagProxy

Class Ext.data.ScriptTagProxy

Package:Ext.data
Defined In:ScriptTagProxy.js
Class:ScriptTagProxy
Extends:DataProxy
An implementation of Ext.data.DataProxy that reads a data object from a URL which may be in a domain other than the originating domain of the running page.

Note that if you are retrieving data from a page that is in a domain that is NOT the same as the originating domain @@ -27,6 +27,19 @@ Writer out = response.getWriter(); 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);
 }

Config Options

Config OptionsDefined By
 doRequest : Function
Abstract method that should be implemented in all subclasses +javascript output which calls this named function passing the data object as its only parameter.
ScriptTagProxy
 nocache : Boolean
Defaults to true. Disable caching by adding a unique parameter -name to the request.
ScriptTagProxy