API Docs for:
Show:

Util Class

Defined in: latest/core.js:7
Module: Core
Parent Module: JSFramework

General utilities

Item Index

Methods

buildQueryString

(
  • Hash
)
String

Defined in latest/core.js:40

URL encode some data, for POSTing or use in a GET querystring. Supports a single level of arrays or objects in the data hash. These will be formatted as a PHP array.

Parameters:

  • Hash Object

    Hash of data

Returns:

String: URL encoded querystring

Example:

var stuff = 
{
    hello: 'world',
    foo: 'bar',
    arrayTest: [1, 2, 3],
    objectTest: 
    {
        one: 'two',
        three: 'four'
    }
};

Util.buildQueryString(stuff) // returns hello=world&foo=bar&arrayTest[]=1&arrayTest[]=2&objectTest[one]=two&objectTest[three]=four

extend

(
  • destination
  • source
)
Object

Defined in latest/core.js:18

Add all elements from source to destination and return the modified destination (for chaining)

Parameters:

  • destination Object

    Object to copy properties to

  • source Object

    Object to copy properties from

Returns:

Object: An object with all the combined properties

Example:

var first = { hello: 'world' };
var second = { foo: 'bar' };
var result = Util.extend(first, second);
// first and result now both contain { hello: 'world', foo: 'bar'}