getHost (XSPUrl - JavaScript)

Gets the host name or address of the URL.

Defined in

XSPUrl (JavaScript)

Syntax

getHost() : string
Return value Description
string The host name or address.

Example

This example gets the host of the URL for the current context.
function p(stuff) {
	print("<<<" + stuff + ">>>");
}

var url : XSPUrl;

try {
	url = context.getUrl();
	p("getHost = " + url.getHost());

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

Print output from the example might be as follows:

<<<getHost = myhost.ibm.com>>>