root/lang/javascript/JSONScriptRequest/doc/html/JSONScriptRequest.html @ 1080

Revision 1080, 3.5 kB (checked in by holidays-l, 6 years ago)

lang/javascript/JSONScriptRequest: Call the JSONP API like XMLHttpRequest

Line 
1<html><head><title>JSONScriptRequest</title>
2<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" >
3</head>
4<body class='pod'>
5<!--
6  generated by Pod::Simple::HTML v3.03,
7  using Pod::Simple::PullParser v2.02,
8  under Perl v5.008008 at Sun Nov  4 04:10:53 2007 GMT.
9
10 If you want to change this HTML document, you probably shouldn't do that
11   by changing it directly.  Instead, see about changing the calling options
12   to Pod::Simple::HTML, and/or subclassing Pod::Simple::HTML,
13   then reconverting this document from the Pod source.
14   When in doubt, email the author of Pod::Simple::HTML for advice.
15   See 'perldoc Pod::Simple::HTML' for more info.
16
17-->
18
19<!-- start doc -->
20<a name='___top' class='dummyTopAnchor' ></a>
21
22<h1><a class='u' href='#___top' title='click to go to top of document'
23name="NAME"
24>NAME</a></h1>
25
26<p>JSONScriptRequest - Call the JSONP API like XMLHttpRequest</p>
27
28<h1><a class='u' href='#___top' title='click to go to top of document'
29name="SYNOPSIS"
30>SYNOPSIS</a></h1>
31
32<pre>  var req = new JSONScriptRequest();
33  req.open(&#39;GET&#39;, &#39;http://www.example.com/jsonp&#39;);
34  req.onreadystatechange = function() {
35      if (req.readyState == 4) {
36          alert(req.responseJSON);
37      }
38  };
39  req.send(null);</pre>
40
41<h1><a class='u' href='#___top' title='click to go to top of document'
42name="DESCRIPTION"
43>DESCRIPTION</a></h1>
44
45<p>JSONScriptRequest calls JSON API by using the SCRIPT element. It enables the cross-site request.</p>
46
47<p>Its usage looks like XMLHttpRequest. See the document of XMLHttpRequest for details.</p>
48
49<h2><a class='u' href='#___top' title='click to go to top of document'
50name="Class_Properties"
51>Class Properties</a></h2>
52
53<h3><a class='u' href='#___top' title='click to go to top of document'
54name="responseJSON"
55>responseJSON</a></h3>
56
57<pre>  var json = req.responseJSON;</pre>
58
59<p>This attributes represents the response as a JSON object. NULL if the request is unsuccessful or has not yet been sent.</p>
60
61<h2><a class='u' href='#___top' title='click to go to top of document'
62name="Constructor"
63>Constructor</a></h2>
64
65<h3><a class='u' href='#___top' title='click to go to top of document'
66name="JSONScriptRequest({...})"
67>JSONScriptRequest({...})</a></h3>
68
69<p>The following values can be specified for the argument.</p>
70
71<dl>
72<dt><a name="callback_param"
73>callback_param</a></dt>
74
75<dd>
76<p>The name of the callback parameter key. Default is &#39;callback&#39;.</p>
77</dd>
78</dl>
79
80<h1><a class='u' href='#___top' title='click to go to top of document'
81name="TODO"
82>TODO</a></h1>
83
84<dl>
85<dt><a name="Implement_the_features_that_is_not_implemented_yet."
86>Implement the features that is not implemented yet.</a></dt>
87</dl>
88
89<h1><a class='u' href='#___top' title='click to go to top of document'
90name="SEE_ALSO"
91>SEE ALSO</a></h1>
92
93<p>The XMLHttpRequest Object <a href="http://www.w3.org/TR/XMLHttpRequest/" class="podlinkurl"
94>http://www.w3.org/TR/XMLHttpRequest/</a></p>
95
96<h1><a class='u' href='#___top' title='click to go to top of document'
97name="AUTHOR"
98>AUTHOR</a></h1>
99
100<p>Hironori Yoshida &#60;yoshida@cpan.org&#62;</p>
101
102<h1><a class='u' href='#___top' title='click to go to top of document'
103name="COPYRIGHT"
104>COPYRIGHT</a></h1>
105
106<pre>  Copyright (c) 2006, Hironori Yoshida &#60;yoshida@cpan.org&#62;. All rights reserved.
107  This module is free software; you can redistribute it and/or modify it
108  under the terms of the Artistic license. Or whatever license I choose,
109  which I will do instead of keeping this documentation like it is.</pre>
110
111<!-- end doc -->
112
113</body></html>
Note: See TracBrowser for help on using the browser.