mozilla
Your Search Results

    URLSearchParams

    This is an experimental technology
    Because this technology's specification has not stabilized, check the compatibility table for the proper prefixes to use in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the spec changes.

    The URLSearchParams interface defines utility methods to work with the query string of a URL.

    Constructor

    URLSearchParams()
    Constructor returning a URLSearchParams object.

    Methods

    This interface doesn't inherit any method.

    URLSearchParams.append()
     
    URLSearchParams.delete()
     
    URLSearchParams.get()
     
    URLSearchParams.getAll()
     
    URLSearchParams.has()
     
    URLSearchParams.set()
     

    Properties

    This interface doesn't inherit any property.

    Examples

    var paramsString = "q=URLUtils.searchParams&topic=api"
    var searchParams = new URLSearchParams(paramsString);
    
    searchParams.has("topic") === true; // true
    searchParams.get("topic") === "api"; // true
    searchParams.getAll("topic"); // ["api"]
    searchParams.get("foo") === null; // true
    searchParams.append("topic", "webdev");
    searchParams.toString(); // "q=URLUtils.searchParams&topic=api&topic=webdev"
    searchParams.delete("topic");
    searchParams.toString(); // "q=URLUtils.searchParams"
    

    Specifications

    Specification Status Comment
    URL
    The definition of 'URLSearchParams' in that specification.
    Living Standard Initial definition

    Browser compatibility

    Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
    Basic support Not supported 29.0 (29.0) Not supported Not supported Not supported
    Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
    Basic support Not supported Not supported 29.0 (29.0) Not supported Not supported Not supported

    See also




     
     

    Document Tags and Contributors

    Contributors to this page: Noitidart, baku, mnoorenberghe, Jxck, teoli
    Last updated by: teoli,