URL extension type
The URL
interface is used to parse, construct, normalize, and encode .
It works by providing properties which allow you to easily read and modify
the components of a URL.
You normally create a new URL
object by specifying the URL as a string
when calling its constructor, or by providing a relative URL and a base URL.
You can then easily read the parsed components of the URL or make changes to
the URL.
If a browser doesn't yet support the URL.URL
constructor, you can access a
URL object using the Window interface's URL property. Be sure to check
to see if any of your target browsers require this to be prefixed.
Properties
- hash ↔ String
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- host ↔ String
-
getter/setter pair
- hostname ↔ String
-
getter/setter pair
- href ↔ String
-
getter/setter pair
- origin → String
-
no setter
- password ↔ String
-
getter/setter pair
- pathname ↔ String
-
getter/setter pair
- port ↔ String
-
getter/setter pair
- protocol ↔ String
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- search ↔ String
-
getter/setter pair
- searchParams → URLSearchParams
-
no setter
- username ↔ String
-
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJSON(
) → String -
The
toJSON()
method of the URL interface returns a string containing a serialized version of the URL, although in practice it seems to have the same effect as URL.toString. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
canParse(
String url, [String base]) → bool -
createObjectURL(
JSObject obj) → String -
revokeObjectURL(
String url) → void