UrlUtil
This page details the UrlUtil endpoints and the actions they support. It covers key functions, parameters, and sample code for easy implementation.
- URL:
/jw/js/json/util.js
- Auto included in all userview pages.
- Convenient method to deal with URL.
constructUrlQueryString(params)
Used to generate a query string based on a parameters object.
- Parameters:
params
- an object contains all parameters as attribute names and their values in the array.
- Sample code:
encodeUrlParam(url)
Used to encode the URL parameters in a URL.
- Parameters:
url
- URL with parameters to be encoded. Note that it uses "&" and "=" as separators.
- Sample code:
getUrlParams(url)
Used to get an object containing all parameters as attribute name and its value in a URL.
- Parameters:
url
- URL to be parsed to retrieve all parameters and their value in the array.
- Sample code:
mergeRequestQueryString(queryString1, queryString2)
Used to merge 2 URL query parameter strings into one query string.
- Parameters:
queryString1
- first query parameters stringqueryString2
- second query parameters string. If a parameter exists in both query strings, the value in the second query string will override the first one.
- Sample code: