root/lang/javascript/IFrameHttpRequest/index.html @ 6710

Revision 1543, 0.7 kB (checked in by mattn, 6 years ago)

lang/javascript/IFrameHttpRequest/IFrameHttpRequest.js,
lang/javascript/IFrameHttpRequest/index.html:

fixed bug that non-http method does not work.

  • Property svn:mime-type set to text/html
Line 
1<html><head><title>IFrameHttpRequest</title>
2<script type="text/javascript" src="IFrameHttpRequest.js"></script>
3<script type="text/javascript"><!--
4function load_document() {
5        var xhr = new IFrameHttpRequest();
6        xhr.open('GET', 'README', false);
7        xhr.onreadystatechange = function() {
8                var result = document.getElementById('result');
9                if (xhr.status == 200)
10                        result.innerHTML = '<pre>' + xhr.responseText + '</pre>';
11                else
12                        result.innerHTML = 'failed';
13        };
14        xhr.send(null);
15}
16--></script>
17<body>
18        <h1>IFrameHttpRequest : IFrame based XHR</h1>
19        <input type="button" value="load README" onclick="load_document();"/>
20        <div id="result"></div>
21</body>
22</html>
Note: See TracBrowser for help on using the browser.