File: Ajax.html

package info (click to toggle)
openlayers 2.13.1%2Bds2-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 67,180 kB
  • ctags: 11,977
  • sloc: xml: 7,435; python: 891; sh: 44; makefile: 23
file content (28 lines) | stat: -rw-r--r-- 978 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<html>
<head>
  <script src="../OLLoader.js"></script>
  <script src="../../lib/deprecated.js"></script>
  <script type="text/javascript">

    function test_Ajax_loadUrl(t) {
        t.plan(5);
        var _get = OpenLayers.Request.GET;
        var caller = {};
        var onComplete = function() {};
        var onFailure = function() {};
        var params = {};
        OpenLayers.Request.GET = function(config) {
            t.eq(config.url, "http://example.com/?format=image+kml", "correct url")
            t.eq(config.params, params, "correct params");
            t.eq(config.scope, caller, "correct scope");
            t.ok(config.success === onComplete, "correct success callback");
            t.ok(config.failure === onFailure, "correct failure callback");
        };
        OpenLayers.loadURL("http://example.com/?format=image+kml", params, caller, onComplete, onFailure);
        OpenLayers.Request.GET = _get;
    }
  </script>
</head>
<body>
</body>
</html>