AJAX
From MapbenderWiki
User:Christoph Baudson (Module maintainer)
Contents |
[edit]
Description
[edit]
English
The AJAX module loads an AJAX library in a seperate iframe. The library is addressed by a wrapper. At the moment jQuery is used as library.
[edit]
Deutsch
Läd eine AJAX-Bibliothek in ein iframe. Die Bibliothek wird von einem Wrapper angesprochen. Momentan wird die jQuery-Bibliothek genutzt
[edit]
Files
For this module the following files are required / Für dieses Modul werden die folgenden Dateien benötigt:
- http://trac.osgeo.org/mapbender/browser/trunk/mapbender/http/extensions/jQuery.js?format=raw
- http://trac.osgeo.org/mapbender/browser/trunk/mapbender/http/frames/jquery.html?format=raw
- http://trac.osgeo.org/mapbender/browser/trunk/mapbender/http/javascripts/mod_ajaxWrapper_jQuery.js?format=raw
- http://trac.osgeo.org/mapbender/browser/trunk/mapbender/http/javascripts/map.php?format=raw
[edit]
Functions
mb_ajax_get(url, param, callback function); mb_ajax_post(url, param, callback function) mb_ajax_json(url, param, callback function)
[edit]
SQL
Use this sql statement to insert this module in the corresponding gui / Mit diesem SQL kann das Modul in die entsprechende GUI eingefügen werden:
[edit]
Example
//the ajax wrapper function
mb_ajax_json("../php/mod_addWMSfromfilteredList_server.php", {"command":"getAllWMS"}, function (json, status) {
// status = "success" or status = "error"
// json = the returned variable is a JS object; conversion from JSON-string by jQuery
displayWMS(json.wms);
});
- ...more examples: data exchange, AJAX Tutorial

