toSiteRelativeString (XSPUrl - JavaScript™)
Gets the URL as a string in site-relative form.
Defined in
XSPUrl (JavaScript)Syntax
toSiteRelativeString(context:XSPContext) : string
Parameters | Description |
---|---|
context |
The context of the site. |
Return value | Description |
---|---|
string |
A string representation of the URL in site-specific form. |
Example
This example gets the current URL relative to the current site as a string.function p(stuff) {
print("<<<" + stuff + ">>>");
}
var url : XSPUrl;
try {
url = context.getUrl();
p("toSiteRelativeString = " + url.toSiteRelativeString(context));
} catch(e) {
p("Error = " + e);
}
Print output from the example might be as follows:
<<<toSiteRelativeString = /page1.xsp?WP_BUSINESS_OBJECT_DATA=rp0707test1&WP_BUSINESS_OBJECT=ejb%2Fcom%2Fibm%2Fworkplace%2Fdesigner%2Fejb%2FDesignerComponent&action=openDocument&database=rp0707test1&schema=Schema_form1&id=3fb66696c9e31&autoedit=true>>>