setAddress (XSPUrl - JavaScript)

Sets the full address of the URL.

Defined in

XSPUrl (JavaScript)

Syntax

setAddress(address:string) : void
Parameters Description
address The new address which must be a valid URL.

Usage

This method sets the scheme, host, port, path, fragment, and query string accordingly. Component values are empty if not specified in the address.

Example

This example sets the address for a new XSPUrl object.
function p(stuff) {
	print("<<<" + stuff + ">>>");
}

var url : XSPUrl;

try {
	url = new XSPUrl("");
	url.setAddress("http://myhost.ibm.com:10038/wps/PA_cow3tik/page1.xsp");
	p(url.toString());

} catch(e) {
	p("Error = " + e);
}

Print output from the example is as follows:

<<<http://myhost.ibm.com:10038/wps/PA_cow3tik/page1.xsp>>>