Class Roo.data.ScriptTagProxy

Package:Roo.data
Defined In: Roo/data/ScriptTagProxy.js.
Class:ScriptTagProxy
An implementation of Roo.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
of the running page, you must use this class, rather than DataProxy.




The content passed back from a server resource requested by a ScriptTagProxy is executable JavaScript
source code that is used as the source inside a <script> tag.



In order for the browser to process the returned data, the server must wrap the data object
with a call to a callback function, the name of which is passed as a parameter by the ScriptTagProxy.
Below is a Java example for a servlet which returns data for either a ScriptTagProxy, or an HttpProxy
depending on whether the callback name was passed:



boolean scriptTag = false;
String cb = request.getParameter("callback");
if (cb != null) {
scriptTag = true;
response.setContentType("text/javascript");
} else {
response.setContentType("application/x-json");
}
Writer out = response.getWriter();
if (scriptTag) {
out.write(cb + "(");
}
out.print(dataBlock.toJsonString());
if (scriptTag) {
out.write(");");
}
Class Comments / Notes => [Add Your comment/notes about this class]
Config Options (Usually are also Properties)
Options Defined By
Public Properties - Has None
Public Methods
Method Defined By
Events - Has None
Documentation generated by Introspection Doc Generator on Fri Jul 13 2018 14:10:54 GMT+0800 (HKT) Based on JsDoc Toolkit