AJAX

From MapbenderWiki

Jump to: navigation, search

User:Christoph Baudson (Module maintainer)

Contents

Description

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.

Deutsch

Läd eine AJAX-Bibliothek in ein iframe. Die Bibliothek wird von einem Wrapper angesprochen. Momentan wird die jQuery-Bibliothek genutzt

Files

For this module the following files are required / Für dieses Modul werden die folgenden Dateien benötigt:

Functions

mb_ajax_get(url, param, callback function);
mb_ajax_post(url, param, callback function)
mb_ajax_json(url, param, callback function)

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:

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);
});
Personal tools