ready

document.ready(fn)

fnfunction to call when DOM is loaded

callback called when DOM is loaded

document.ready(function(){ console.log("DOM loaded"); }

getJSON

document.getJSON(url, onSuccess [, onError, options])

urlA string containing the URL to which the request is sent.

onSuccessA callback function that is executed if the request succeeds.

onErrorA callback function that is executed if the request occurs errors.

optionsoptions

Load JSON-encoded data from the server using a GET HTTP request.

Work only on server

ajax

document.ajax(url, onSuccess [, onError, options])

urlA string containing the URL to which the request is sent.

onSuccessA callback function that is executed if the request succeeds.

onErrorA callback function that is executed if the request occurs errors.

optionsoptions

Load data from the server using a GET HTTP request.

getScripts

document.getScripts(arrScriptsUrl)

arrScriptsUrlarray of scripts urls

Load javascript resources in the document

getScriptsIf

document.getScriptsIf(condition,arrScriptsUrl)

conditiona boolean

arrScriptsUrlarray of scripts urls

Load javascript resources in the document if the condition is true

getStyles

document.getStyles(arrStylesUrl)

arrStylesUrlarray of css urls

Load css resources in the document