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 565

Methods

abort(event)

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

on_down_progress(event)

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

on_download_end(event)

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

on_up_progress(event)

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

on_upload_end(event)

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

process_error(event)

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

process_response(event)

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

ready_state_change(event)

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

reset()

ajax.js, line 631
Resets the sender state.

send(settings){boolean|undefined}

ajax.js, line 1199
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 757
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 1041
Updates response data after a download.
Name Type Description
event ProgressEvent The progress event.

staticH_ajax_sender.process_json(result)

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