[Mapbender-commits] r4257 - trunk/mapbender/lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Jun 26 10:59:24 EDT 2009


Author: christoph
Date: 2009-06-26 10:59:23 -0400 (Fri, 26 Jun 2009)
New Revision: 4257

Added:
   trunk/mapbender/lib/backwards_compatibility_to_2.6.js
Log:


Added: trunk/mapbender/lib/backwards_compatibility_to_2.6.js
===================================================================
--- trunk/mapbender/lib/backwards_compatibility_to_2.6.js	                        (rev 0)
+++ trunk/mapbender/lib/backwards_compatibility_to_2.6.js	2009-06-26 14:59:23 UTC (rev 4257)
@@ -0,0 +1,71 @@
+var ie = $.browser.msie;
+var n6 = document.getElementById&&!document.all?1:0;
+var n4 = document.layers?1:0;
+
+var mb_log = Mapbender.log;
+
+var mb_timestamp = Mapbender.getTimestamp;
+
+
+// Should be moved to a deprecated file
+var Mb_notice = Mapbender.Notice;
+var Mb_warning = Mapbender.Warning;
+var Mb_exception = Mapbender.Exception;
+
+
+
+/**
+ * A wrapper for an AJAX request via GET 
+ * 
+ * @deprecated
+ * @param {String} url the URL of a (presumably a server side) script.
+ * @param {Object} param An object containing parameters, f.e. {name1:value1, name2:value2}
+ * @param {Function} callback A function that is called when the server side script has been processed. The function is called with two parameters, result and status. Result is the output of the server side script (XML, HTML, whatever), status is a {String}, either "success" or "error". 
+ */
+function mb_ajax_get(url, param, callback) {
+	try {
+//		$.ajaxSetup({async:false}); 
+		$.get(url, param, callback);
+	}
+	catch(e) {
+		var error = new Mb_exception('map.php: mb_ajax_get:'+e);
+	}
+}	
+
+/**
+ * A wrapper for an AJAX request via POST 
+ *
+ * @deprecated
+ * @param {String} url the URL of a (presumably a server side) script.
+ * @param {Object} param An object containing parameters, f.e. {name1:value1, name2:value2}
+ * @param {Function} callback A function that is called when the server side script has been processed. The function is called with two parameters, result and status. Result is the output of the server side script (XML, HTML, whatever), status is a {String}, either "success" or "error". 
+ */
+function mb_ajax_post(url, param, callback) {
+	try {
+//		$.ajaxSetup({async:false}); 
+		$.post(url, param, callback);
+	}
+	catch(e) {
+		var error = new Mb_exception('map.php: mb_ajax_post:'+e);
+	}
+}	
+	
+/**
+ * A wrapper for an AJAX request via GET 
+ *
+ * @deprecated
+ * @param {String} url the URL of a (presumably a server side) script.
+ * @param {Object} param An object containing parameters, f.e. {name1:value1, name2:value2}
+ * @param {Function} callback A function that is called when the server side script has been processed. The function is called with two parameters, result and status. Result is the output of the server side script (a JavaScript Object, not a String!), status is a {String}, either "success" or "error". 
+ */
+function mb_ajax_json(url, param, callback) {
+	try {
+//		window.frames['ajax'].$.ajaxSetup({async:false}); //TODO: find out why async doesn't work sometimes
+		$.getJSON(url, param, callback);
+	}
+	catch(e) {
+		var error = new Mb_exception('map.php: mb_ajax_json:'+e);
+	}
+}
+
+



More information about the Mapbender_commits mailing list