This project is read-only.

toURLEncoded()

Creates a URL-encoded string from an iteratable object.

Syntax

Return Value

A URL-encoded string.

Examples

var data = {
    a: 1,
    b: 2,
    c: [3, 4, 5],
    d: {
        e: 6,
        f: "foo",
        g: [7, 8]
    }
};

var urlEncoded = $from(data).toURLEncoded();
document.writeln(urlEncoded);

/*
This code produces the following output:

a=1&b=2&c[0]=3&c[1]=4&c[2]=5&d[e]=6&d[f]=foo&d[g][0]=7&d[g][1]=8
*/

Last edited May 18, 2012 at 11:40 AM by suckgamoni, version 2

Comments

No comments yet.