getSiteRelativeAddress (XSPUrl - JavaScript)

Gets the address of a site starting with the root directory (omitting the scheme, host, port, and fragment).

Defined in

XSPUrl (JavaScript)

Syntax

getSiteRelativeAddress(context:XSPContext) : string
Parameters Description
context The context of the site.
Return value Description
string The site-relative address.

Example

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

var url : XSPUrl;

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

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

Print output from the example might be as follows:

<<<getSiteRelativeAddress = /page1.xsp>>>