getParameterName (XSPUrl - JavaScript)

Gets the name of a query string parameter.

Defined in

XSPUrl (JavaScript)

Syntax

getParameterName(index:int) : string
Parameters Description
index The index, starting at 0, of an existing parameter.
Return value Description
string The name of the parameter.

Example

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

var url : XSPUrl;

try {
	url = context.getUrl();
	var n = url.getParametersCount();
	p("getParametersCount = " + n);
	for(var i=0; i<n; i++) {
		p(url.getParameterName(i));
	}

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

Print output from the example might be as follows:

<<<getParametersCount = 7>>>
<<<WP_BUSINESS_OBJECT_DATA>>>
<<<WP_BUSINESS_OBJECT>>>
<<<action>>>
<<<database>>>
<<<schema>>>
<<<id>>>
<<<autoedit>>>