[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/lib/yuilib/3.17.2/jsonp/ -> jsonp-debug.js (summary)

(no description)

File Size: 263 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 functions

  JSONPRequest()
  wrap()

Functions
Functions that are not part of a class:

JSONPRequest()   X-Ref
<p>Provides a JSONPRequest class for repeated JSONP calls, and a convenience
method Y.jsonp(url, callback) to instantiate and send a JSONP request.</p>

<p>Both the constructor as well as the convenience function take two
parameters: a url string and a callback.</p>

<p>The url provided must include the placeholder string
&quot;{callback}&quot; which will be replaced by a dynamically
generated routing function to pass the data to your callback function.
An example url might look like
&quot;http://example.com/service?callback={callback}&quot;.</p>

<p>The second parameter can be a callback function that accepts the JSON
payload as its argument, or a configuration object supporting the keys:</p>
<ul>
<li>on - map of callback subscribers
<ul>
<li>success - function handler for successful transmission</li>
<li>failure - function handler for failed transmission</li>
<li>timeout - function handler for transactions that timeout</li>
</ul>
</li>
<li>format  - override function for inserting the proxy name in the url</li>
<li>timeout - the number of milliseconds to wait before giving up</li>
<li>context - becomes <code>this</code> in the callbacks</li>
<li>args    - array of subsequent parameters to pass to the callbacks</li>
<li>allowCache - use the same proxy name for all requests? (boolean)</li>
</ul>

param: url {String} the url of the JSONP service
param: callback {Object|Function} the default callback configuration or

wrap(fn, isTimeout)   X-Ref
No description



Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1