Skip to content
This repository

HAX HtmlAjaX 

Fedik edited this page · 2 revisions

About HAX (HtmlAjaX)

hax – one of a function of FullAJAX, used for request and automatic processing a HTML (HtmlAjaX) — this is AHAH support (Asynchronous HTML and HTTP).

List of HAX options:

  • url/src – requested URL.
  • id – parent 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.
  • nohistory (noHistory) - using history of AJAX Navigation. default false – history saved.
  • rc – specifies whether to use relative links correction. true or false (default false).
  • overwrite – Overwrite events onclick and onsubmit with Fly AJAX (The default function onclick and onsubmit eventsnot overwritten, they are supplemented). true or false (default false).
  • destroy – remove the process from memory after request. true or false (default false).
  • html – HTML text, emulation response. In the presence of this parameter request to the server is not made.
  • anticache/nocache – cache disabled. true or false (default false).
  • startpage – sign of the first page of history.true or false (default false).
  • async – use of asynchronous request. true or false (default true).
  • historycache – usage cache of the history. true or false (default USE_HISTORY_CACHE).
  • seal – sign of the isolation. Used to resolve conflicts css styles. true or false (default false).
  • 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.
  • add – determines how to add loaded content to parent: Overwrite – false, or Add – true (default false).
  • onload – function that is called after full loaded content.
  • loader – id load indicator.
  • notitle – disable autocorrect title. true or false (default false).
  • onerror – function to be called in case of error loading content.
  • 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

In the element id="my-div" will loaded page index.html with using AJAX history:

hax({url:'index.html', id:'my-div'})

In the element id="my-div" will loaded page index.html without using AJAX history. After it will appears message "Hey!":

hax({url:'index.html', id:'my-div', nohistory:1, onload:function(){
Something went wrong with that request. Please try again.