diff options
author | Chris Schlaeger <chris@linux.com> | 2014-08-12 21:56:44 +0200 |
---|---|---|
committer | Chris Schlaeger <chris@linux.com> | 2014-08-12 21:56:44 +0200 |
commit | ea346a785dc1b3f7c156f6fc33da634e1f1a627b (patch) | |
tree | af67530553d20b6e82ad60fd79593e9c4abf5565 /misc/openlayers/tests/manual/ajax.html | |
parent | 59741cd535c47f25971bf8c32b25da25ceadc6d5 (diff) | |
download | postrunner-ea346a785dc1b3f7c156f6fc33da634e1f1a627b.zip |
Adding jquery, flot and openlayers to be included with the GEM.v0.0.4
Diffstat (limited to 'misc/openlayers/tests/manual/ajax.html')
-rw-r--r-- | misc/openlayers/tests/manual/ajax.html | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/misc/openlayers/tests/manual/ajax.html b/misc/openlayers/tests/manual/ajax.html new file mode 100644 index 0000000..be038ad --- /dev/null +++ b/misc/openlayers/tests/manual/ajax.html @@ -0,0 +1,49 @@ +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>XHR Acceptance Test</title> + <script src="../../lib/OpenLayers.js"></script> + <script type="text/javascript"> + var url = "ajax.txt"; + function sendSynchronous(){ + var request = OpenLayers.Request.GET({ + url: url, + async: false, + callback: function() { + document.getElementById('send_sync').value += 'request completed\n'; + } + }); + document.getElementById('send_sync').value += 'other processing\n'; + } + function sendAsynchronous(){ + var request = OpenLayers.Request.GET({ + url: url, + callback: function() { + document.getElementById('send_sync').value += 'request completed\n'; + } + }); + document.getElementById('send_sync').value += 'other processing\n'; + } + function sendAndAbort(){ + var request = OpenLayers.Request.GET({ + url: url, + callback: function() { + document.getElementById('send_sync').value += 'never called\n'; + } + }); + request.abort(); + document.getElementById('send_sync').value += 'other processing\n'; + } + + </script> + </head> + <body > + <button onclick="sendSynchronous()">synchronous</button> + expected output: "request completed" then "other processing"<br /> + <button onclick="sendAsynchronous()">asynchronous</button> + expected output: "other processing" then "request completed"<br /> + <button onclick="sendAndAbort()">send and abort</button> + expected output: "other processing" (and not "never called")<br /> + <textarea id="send_sync" rows="6"></textarea><br /> + <button onclick="document.getElementById('send_sync').value = ''">Clear</button> + </body> +</html> |