Name
getHost — Return the host extracted from a URL
Usage
URL.getHost(url)
: Stringurl
Description
Returns the host part extracted from url
.
This function supports both absolute and relative URLs. Returns the
empty string if url
doesn’t specify
a host.
Returns invalid
if url
can’t be converted to a string or can’t be parsed as a
URL.
Examples
URL.getHost("http://www.inhand.net/")
returns string "www.inhand.net"
URL.getHost("../logo.wbmp")
returns string ""
URL.getHost("http://www.inhand.net:xxx/")
returns invalid
URL.getHost(invalid)
returns invalid
Get Learning WML, and WMLScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.