📄 ext.data.scripttagproxy.html.svn-base
字号:
<div class="body-wrap"> <div class="top-tools"> <a class="inner-link" href="#Ext.data.ScriptTagProxy-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a> <a class="inner-link" href="#Ext.data.ScriptTagProxy-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a> <a class="inner-link" href="#Ext.data.ScriptTagProxy-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a> <a class="inner-link" href="#Ext.data.ScriptTagProxy-configs"><img src="../resources/images/default/s.gif" class="item-icon icon-config">Config Options</a> <a class="bookmark" href="../docs/?class=Ext.data.ScriptTagProxy"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a> </div> <div class="inheritance res-block"><pre class="res-block-inner"><a ext:cls="Ext.util.Observable" ext:member="" href="output/Ext.util.Observable.html">Observable</a> <img src="resources/elbow-end.gif"/><a ext:cls="Ext.data.DataProxy" ext:member="" href="output/Ext.data.DataProxy.html">DataProxy</a> <img src="resources/elbow-end.gif"/>ScriptTagProxy</pre></div> <h1>Class Ext.data.ScriptTagProxy</h1> <table cellspacing="0"> <tr><td class="label">Package:</td><td class="hd-info">Ext.data</td></tr> <tr><td class="label">Defined In:</td><td class="hd-info">ScriptTagProxy.js</td></tr> <tr><td class="label">Class:</td><td class="hd-info">ScriptTagProxy</td></tr> <tr><td class="label">Extends:</td><td class="hd-info"><a ext:cls="Ext.data.DataProxy" ext:member="" href="output/Ext.data.DataProxy.html">DataProxy</a></td></tr> </table> <div class="description"> An implementation of Ext.data.DataProxy that reads a data object from a URL which may be in a domainother than the originating domain of the running page.<br><p><b>Note that if you are retrieving data from a page that is in a domain that is NOT the same as the originating domainof the running page, you must use this class, rather than HttpProxy.</b><br><p>The content passed back from a server resource requested by a ScriptTagProxy <b>must</b> be executable JavaScriptsource code because it is used as the source inside a <script> tag.<br><p>In order for the browser to process the returned data, the server must wrap the data objectwith 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 HttpProxydepending on whether the callback name was passed:<p><pre><code>boolean scriptTag = false;String cb = request.getParameter(<em>"callback"</em>);<b>if</b> (cb != null) { scriptTag = true; response.setContentType(<em>"text/javascript"</em>);} <b>else</b> { response.setContentType(<em>"application/x-json"</em>);}Writer out = response.getWriter();<b>if</b> (scriptTag) { out.write(cb + <em>"("</em>);}out.print(dataBlock.toJsonString());<b>if</b> (scriptTag) { out.write(<em>");"</em>);}</code></pre> </div> <div class="hr"></div> <a id="Ext.data.ScriptTagProxy-configs"></a> <h2>Config Options</h2> <table cellspacing="0" class="member-table"> <tr> <th class="sig-header" colspan="2">Config Options</th> <th class="msource-header">Defined By</th> </tr> <tr class="config-row expandable">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.data.ScriptTagProxy-callbackParam"></a>
<b>callbackParam</b> : String <div class="mdesc">
<div class="short">(Optional) The name of the parameter to pass to the server which tells the server the name of the callback function s...</div>
<div class="long">
(Optional) The name of the parameter to pass to the server which tells the server the name of the callback function set up by the load call to process the returned data object. Defaults to "callback".<p>The server-side processing must read this parameter value, and generate javascript output which calls this named function passing the data object as its only parameter. </div>
</div>
</td>
<td class="msource">ScriptTagProxy</td>
</tr>
<tr class="config-row inherited alt expandable">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.data.ScriptTagProxy-listeners"></a>
<b>listeners</b> : Object <div class="mdesc">
<div class="short">A config object containing one or more event handlers to be added to this object during initialization. This should b...</div>
<div class="long">
A config object containing one or more event handlers to be added to this object during initialization. This should be a valid listeners config object as specified in the <a ext:cls="Ext.util.Observable" ext:member="addListener" href="output/Ext.util.Observable.html#addListener">addListener</a> example for attaching multiple handlers at once. </div>
</div>
</td>
<td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#listeners" href="output/Ext.util.Observable.html#listeners">Observable</a></td>
</tr>
<tr class="config-row">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.data.ScriptTagProxy-nocache"></a>
<b>nocache</b> : Boolean <div class="mdesc">
(optional) Defaults to true. Disable caching by adding a unique parameter name to the request. </div>
</td>
<td class="msource">ScriptTagProxy</td>
</tr>
<tr class="config-row alt">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.data.ScriptTagProxy-timeout"></a>
<b>timeout</b> : Number <div class="mdesc">
(optional) The number of milliseconds to wait for a response. Defaults to 30 seconds. </div>
</td>
<td class="msource">ScriptTagProxy</td>
</tr>
<tr class="config-row">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.data.ScriptTagProxy-url"></a>
<b>url</b> : String <div class="mdesc">
The URL from which to request the data object. </div>
</td>
<td class="msource">ScriptTagProxy</td>
</tr>
</table> <a id="Ext.data.ScriptTagProxy-props"></a> <h2>Public Properties</h2> <div class="no-members">This class has no public properties.</div> <a id="Ext.data.ScriptTagProxy-methods"></a> <h2>Public Methods</h2> <table cellspacing="0" class="member-table"> <tr> <th class="sig-header" colspan="2">Method</th> <th class="msource-header">Defined By</th> </tr> <tr class="method-row expandable">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.data.ScriptTagProxy-ScriptTagProxy"></a>
<b>ScriptTagProxy</b>( <code>Object config</code> ) <div class="mdesc">
<div class="short"></div>
<div class="long">
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>config</code> : Object<div class="sub-desc">A configuration object.</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code></code></li>
</ul>
</div>
</div>
</div>
</td>
<td class="msource">ScriptTagProxy</td>
</tr>
<tr class="method-row alt expandable">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.data.ScriptTagProxy-abort"></a>
<b>abort</b>() : void <div class="mdesc">
<div class="short">Abort the current server request.</div>
<div class="long">
Abort the current server request. <div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li>None.</li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
</div>
</td>
<td class="msource">ScriptTagProxy</td>
</tr>
<tr class="method-row inherited expandable">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.data.ScriptTagProxy-addEvents"></a>
<b>addEvents</b>( <code>Object object</code> ) : void <div class="mdesc">
<div class="short">Used to define events on this Observable</div>
<div class="long">
Used to define events on this Observable <div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>object</code> : Object<div class="sub-desc">The object with the events defined</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -