URL Library

The URL library contains functions used in URL manipulation.

escapeString

Description: Replaces special characters contained in a string with hexadecimal equivalents.

Syntax: URL.escapeString(string)

Example: The following example escapes a URL query string:

// Escape query string
var=qs=URL.escapeString(qs);
// Append to url
url=url+"?"+qs;

getBase

Description: Returns the absolute URL path of the current WMLS file.

Syntax: URL.getBase()

Example: The following example displays the URL of the script file being executed:

// Display file being executed
dialogs.Alert("Executing "+URL.getBase());

getFragment

Description: Returns the fragment (bookmark) portion of a URL. getFragment() supports both absolute and relative URLs.

Syntax: ...

Get WAP Development with 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.