Name

isValid — Check if a URL has valid syntax

Usage

URL.isValid(url)

url : String

Description

Returns true if url has valid syntax; returns false otherwise. Valid URL syntax is summarized in Appendix A. Relative URLs are permitted.

Returns invalid if url can’t be converted to a string.

Examples

URL.isValid("http://www.inhand.net/")

returns Boolean true

URL.isValid("../logo.wbmp")

returns Boolean true

URL.isValid("#frag")

returns Boolean true

URL.isValid("http://www.inhand.net:xxx/")

returns Boolean false

URL.isValid(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.