Skip to content
Fedir Zinchuk edited this page Mar 6, 2019 · 2 revisions

About DAX (DataAjaX)

dax – one of a function of FullAjax, used for request a text data, xml, json, and similar (DataAjaX).

List of DAX options:

  • url/src – requested URL.
  • id – internal thread id.
  • method – request method. post or get (default get).
  • form – form id, form, element id, or element from which to collect data.
  • params – parameters that should be added to the query (Example: params:’name=val1&dat=val2′).
  • callback/cb – callback function.
  • callbackOps/cbo – options transferred to the callback function.
  • destroy – remove the process from memory after request. true or false (default false).
  • anticache/nocache – cache disabled. true or false (default false).
  • async – use of asynchronous request. true or false (default true).
  • xml – XML, emulation response. In the presence of this parameter request to the server is not made.
  • text – text, emulation response. In the presence of this parameter request to the server is not made.
  • user – username, when a connection requires a username
  • pswd – password, when a connection requires a password
  • headers – array of HTTP headers of the objects {key: value} to be passed to the server. Example: headers:[{Etag: '123'}, {'Accept-Encoding': 'gzip,deflate'}]
  • loader – id load indicator.
  • storage – using local storage. Valid only when SRAX.Storage connected. true or false (default true).
  • etag – Etag use to identify the novelty in the local data repository. Valid only when SRAX.Storage connected. true or false (default true).

###Example using Data from all field (input, textarea, select, so on) of the form with id="myform" will be automatically collected and sent to myurl use post method.

dax({url:'myurl', id:'save-data', form:'myform', method:'post', cb:function(resp, cbo){
	alert(resp.text || resp.xml)
}})

id – it the internal thread id, designed to separate streams of several trips to the server. At the same time, there can be multiple requests with the same id, the following query overrides the previous. Also use id allows to reuse already created in memory objects.

Clone this wiki locally