Packages

object urlMod

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. urlMod
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. class URLSearchParams extends Object with StObject with Iterable[Tuple2[String, String]]

    The URLSearchParams API provides read and write access to the query of aURL.

    The URLSearchParams API provides read and write access to the query of aURL. The URLSearchParams class can also be used standalone with one of the four following constructors. The URLSearchParams class is also available on the global object.

    The WHATWG URLSearchParams interface and the querystring module have similar purpose, but the purpose of the querystring module is more general, as it allows the customization of delimiter characters (& and =). On the other hand, this API is designed purely for URL query strings.

    js const myURL = new URL('https://example.org/?abc=123'); console.log(myURL.searchParams.get('abc')); // Prints 123

    myURL.searchParams.append('abc', 'xyz'); console.log(myURL.href); // Prints https://example.org/?abc=123&abc=xyz

    myURL.searchParams.delete('abc'); myURL.searchParams.set('a', 'b'); console.log(myURL.href); // Prints https://example.org/?a=b

    const newSearchParams = new URLSearchParams(myURL.searchParams); // The above is equivalent to // const newSearchParams = new URLSearchParams(myURL.search);

    newSearchParams.append('a', 'c'); console.log(myURL.href); // Prints https://example.org/?a=b console.log(newSearchParams.toString()); // Prints a=b&a=c

    // newSearchParams.toString() is implicitly called myURL.search = newSearchParams; console.log(myURL.href); // Prints https://example.org/?a=b&a=c newSearchParams.delete('a'); console.log(myURL.href); // Prints https://example.org/?a=b&a=c

    Annotations
    @JSType() @JSImport("url", "URLSearchParams") @native()
    Since

    v7.5.0, v6.13.0

  2. class URL_ extends Object with StObject

    Browser-compatible URL class, implemented by following the WHATWG URL Standard.

    Browser-compatible URL class, implemented by following the WHATWG URL Standard. [Examples of parsed URLs](https://url.spec.whatwg.org/#example-url-parsing) may be found in the Standard itself. The URL class is also available on the global object.

    In accordance with browser conventions, all properties of URL objects are implemented as getters and setters on the class prototype, rather than as data properties on the object itself. Thus, unlike legacy urlObject s, using the delete keyword on any properties of URL objects (e.g. delete myURL.protocol, delete myURL.pathname, etc) has no effect but will still return true.

    Annotations
    @JSType() @JSImport("url", "URL") @native()
    Since

    v7.0.0, v6.13.0

Value Members

  1. object URL_