Glossary Term
URL.canParse()
The URL.canParse() static method of the URL interface returns a boolean indicating whether or not an absolute URL, or a relative URL combined with a base URL, are parsable and valid.
This is a fast and easy alternative to constructing a URL within a try…catch block. It returns true for the same values for which the URL() constructor would succeed, and false for the values that would cause the constructor to throw.
Inputs: url A string or any other object with a stringifier — including, for example, an a or area element — that represents an absolute or relative URL. If url is a relative URL, base is required, and will be used as the base URL. If url is an absolute URL, a given base will be ignored. base A string representing the base URL to use in cases where url is a relative URL. If not specified, it defaults to undefined.
Term Connections
Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.
Loading term connections…
