Function ajax_request
create the js code for a ajax request
all AJAX request pipes will be handeled over the global javascript object "fw_AjaxHandler",
to abort a (delayed) request use fw_AjaxHandler.abort();
,
to check in your code a method is called from ajax check the define MVC_AJAX_EVENT is true
to abort a (delayed) request use fw_AjaxHandler.abort();
CORS requests require to be async and server response header "Access-Control-Allow-*", use as sample the function "enableCORS" to allow
Located at
ajax.lib.php
Parameters summary
integer |
$id |
=> connection id |
string |
$source |
=> script |
string |
$data = "" |
=> sample: var1=Hello&var2=World or js_getFormData('', '', 0, 'frm1') or js_getFormData('', '', 0, 'frm1, frm2') and $dataIsFunction == true |
string |
$callback = "" |
=> name of registered function |
string |
$type = "REQUEST_GET" |
=> REQUEST_HEAD, REQUEST_GET, REQUEST_POST, REQUEST_XML |
boolean |
$dataIsFunction = false |
|
boolean |
$noHistoryBack = false |
=> use or unuse the history handler for this request |
integer |
$wait_ms = 0 |
|
boolean |
$async = false |
|
boolean |
$cache = false |
is true, no request_timestamp will be add to the GET/POST<br>see also the cache control options of function "print_ajax" |
Return value summary
string
|
as js code |