Skip to content

qfFunctions

Katherine ChengLi edited this page Apr 6, 2015 · 1 revision

Quickforms Functions

quickforms.extendClass(className, extender)

If different Javascript functionality is required for a certain form module, this function will allow for an extension of every object created of the "className". For example, if the dom/form/checkbox summary method does not suit your needs, it can be extended like so:

quickforms.extendClass('checkboxElement',function(checkObject){
    checkObject.summary = function(){
        return 'New Summary '+this.value;
    }
});

quickforms.hideLoadingGif()

quickforms.initLoadingGif(maxTime)

quickforms.loadCss(url)

quickforms.mixin(destinationObject, sourceObject)

quickforms.registerReadyFunction(callback)

quickforms.toast(message)

quickforms.tryModule(url, callback)

window.alertJSONError(error)

Used when parsing JSON throws an exception

window.getCookie(cookieName)

Interface to the document.cookie variable. Allows for simple retrieval of cookies by name. This is used extensively for authentication.

window.getParameterByName(name)

Used to retrieve URL parameters. For example, if the URL has the following form "quickforms.com?id=1032&moreVariables=example", both variables can be retrieved like so:

   var id = getParameterByName('id');
   var moreVariables = getParameterByName('moreVariables');

window.isJSONString(string)

window.isNull(object)

window.isNumber(number)

window.setCookie(cookieName, value, numDays)

Clone this wiki locally