Class: H_ajax_sender

H_ajax_sender

Handles a single AJAX request, including upload/download progress, callbacks, and response processing. Used internally by H_ajax.

new H_ajax_sender()

ajax.js, line 568

Methods

abort(event)

ajax.js, line 1273
Aborts the AJAX request.
Name Type Description
event Event optional Optional event.

on_down_progress(event)

ajax.js, line 712
Handles download progress events.
Name Type Description
event ProgressEvent The progress event.

on_download_end(event)

ajax.js, line 1287
Handles the end of a download.
Name Type Description
event Event The event object.

on_up_progress(event)

ajax.js, line 673
Handles upload progress events.
Name Type Description
event ProgressEvent The progress event.

on_upload_end(event)

ajax.js, line 1322
Handles the end of an upload.
Name Type Description
event Event The event object.

process_error(event)

ajax.js, line 1156
Processes AJAX errors.
Name Type Description
event Event The event object.

process_response(event)

ajax.js, line 1092
Processes the AJAX response.
Name Type Description
event Event The event object.

ready_state_change(event)

ajax.js, line 601
Handles ready state changes of the XHR.
Name Type Description
event Event The event object.

reset()

ajax.js, line 634
Resets the sender state.

send(settings){boolean|undefined}

ajax.js, line 1202
Sends the AJAX request.
Name Type Description
settings Object optional Optional AJAX settings.
Returns:
Type Description
boolean | undefined False if not sent.

set_data(settings){boolean}

ajax.js, line 760
Sets data and configuration for the AJAX request.
Name Type Description
settings Object AJAX settings. possible values :
- action = url php script
- data = form dom object, formdata object, or and object with variables to send
- extra_data = object with additional variables to send
- down_progress : progress callback for download
- up_progress : progress callback for upload
- error : error callback
- success : success callback
- json_mode:
- H_ajax.JSON_OFF = 0 = the json string untouched server side
- H_ajax.JSON_ON = 1 = basic json decode server side : js objects are converted to PHP objects and js arrays to PHP arrays
- H_ajax.JSON_ARRAY = 2 = (default) automatically convert json strings to PHP associative arrays when an object or an array is sent
Returns:
Type Description
boolean True if data is set, false otherwise.

update_response_data(event)

ajax.js, line 1044
Updates response data after a download.
Name Type Description
event ProgressEvent The progress event.

staticH_ajax_sender.process_json(result)

ajax.js, line 1067
Processes JSON responses and handles UI feedback.
Name Type Description
result Object | string The AJAX result.