For operation of the module often requires a separate JavaScript-script. There are several options to connect JS-files. Consider the example of them.
You can also add edit, then file connect only to edit or add an item. For example, modules/bs/admin/js/bs.admin.edit.js only connect to form editing / adding banner.
Also automatically connect to the module-connections:
Once the files are automatically loaded for the functions of the file adm/includes/edit_functions.php:
Well, you can also manually set:
$this->diafan->_admin->js_view[] = 'modules/images/admin/js/images.admin.inc.js';
The JS-code also need to take its own characteristics.
To correct the request, checked identification hash, Ajax-requests should be sent through the function diafan_ajax.init()
:
diafan_ajax.init({
data: Transmitted_data_in_JSON_format,
url: Address_to_which_data_is_transmitted,
success: function(response) {
// response processing
}
});
All data are not binding. If returned response.redirect
, the redirection takes place irrespective of what is defined success
.