Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

toURLEncoded()

suckgamoni edited this page · 1 revision

Creates a URL-encoded string from an iterable object.

Syntax

Return Value

A URL-encoded string.


Example

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
*/
Something went wrong with that request. Please try again.