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 576

Methods

staticH_ajax_sender.process_json(result)

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

abort(event)

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

on_down_progress(event)

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

on_download_end(event)

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

on_up_progress(event)

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

on_upload_end(event)

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

process_error(event)

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

process_response(event)

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

ready_state_change(event)

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

reset()

ajax.js, line 642
Resets the sender state.

send(settings){boolean|undefined}

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