From f7ccf9ef4e5e7e5c5a685326c849523c246a3a62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Junod?= Date: Wed, 3 Aug 2011 15:55:14 +0000 Subject: [PATCH] mark the OpenLayers.loadURL method as deprecated (replaced by OpenLayers.Request.GET). r=erilem,rdewit,ahocevar (closes #3443) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12206 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/KMLParser.html | 5 ++++- examples/WMSDescribeLayerParser.html | 7 +++++-- examples/sld.js | 7 +++++-- examples/xml.html | 7 +++++-- lib/OpenLayers/Ajax.js | 4 ++-- 5 files changed, 21 insertions(+), 9 deletions(-) diff --git a/examples/KMLParser.html b/examples/KMLParser.html index 645be9b0c6..a6ec027f02 100644 --- a/examples/KMLParser.html +++ b/examples/KMLParser.html @@ -28,7 +28,10 @@ document.getElementById('output').innerHTML = html; } function load() { - OpenLayers.loadURL("kml/lines.kml", "", null, parseData); + OpenLayers.Request.GET({ + url: "kml/lines.kml", + success: parseData + }); } diff --git a/examples/WMSDescribeLayerParser.html b/examples/WMSDescribeLayerParser.html index f7ed546ac6..0e62465e85 100644 --- a/examples/WMSDescribeLayerParser.html +++ b/examples/WMSDescribeLayerParser.html @@ -9,7 +9,7 @@ diff --git a/examples/sld.js b/examples/sld.js index 21cb295a5d..888a9c6d27 100644 --- a/examples/sld.js +++ b/examples/sld.js @@ -12,10 +12,13 @@ function init() { )); map.addControl(new OpenLayers.Control.LayerSwitcher()); - OpenLayers.loadURL("tasmania/sld-tasmania.xml", null, null, complete); + OpenLayers.Request.GET({ + url: "tasmania/sld-tasmania.xml", + success: complete + }); } -// handler for the loadURL function in the init method +// handler for the OpenLayers.Request.GET function in the init method function complete(req) { sld = format.read(req.responseXML || req.responseText); buildStyleChooser(); diff --git a/examples/xml.html b/examples/xml.html index 48d347a3fd..696229bde7 100644 --- a/examples/xml.html +++ b/examples/xml.html @@ -39,8 +39,11 @@ var doc = null; function init() { - var url = "xml/features.xml"; - OpenLayers.loadURL(url, null, null, loadSuccess, loadFailure); + OpenLayers.Request.GET({ + url: "xml/features.xml", + success: loadSuccess, + failure: loadFailure + }); } function loadSuccess(request) { diff --git a/lib/OpenLayers/Ajax.js b/lib/OpenLayers/Ajax.js index 34e683a587..92235025ae 100644 --- a/lib/OpenLayers/Ajax.js +++ b/lib/OpenLayers/Ajax.js @@ -46,8 +46,8 @@ OpenLayers.nullHandler = function(request) { /** * APIFunction: OpenLayers.loadURL - * Background load a document. For more flexibility in using XMLHttpRequest, - * see the methods. + * Background load a document. + * *Deprecated*. Use method instead. * * Parameters: * uri - {String} URI of source doc