object urlMod
- Alphabetic
- By Inheritance
- urlMod
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- 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
. TheURLSearchParams
class can also be used standalone with one of the four following constructors. TheURLSearchParams
class is also available on the global object.The WHATWG
URLSearchParams
interface and thequerystring
module have similar purpose, but the purpose of thequerystring
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
- 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. TheURL
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, unlikelegacy urlObject
s, using thedelete
keyword on any properties ofURL
objects (e.g.delete myURL.protocol
,delete myURL.pathname
, etc) has no effect but will still returntrue
.- Annotations
- @JSType() @JSImport("url", "URL") @native()
- Since
v7.0.0, v6.13.0
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- object URL_
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated