| Package: | CQ_Analytics |
| Class: | Utils |
| Extends: | Object |
| Clientlib: | personalization.core |
| Method | Defined By | |
|---|---|---|
addParameter( String url, String name, String/String[] value ) : String <static> Adds a parameter to the specified URL. The parameter name and
value will be URL-endcoded.
<static> Adds a parameter to the specified URL. The parameter name and
value will be URL-endcoded.
Parameters:
|
Utils | |
clearElement( String elemId ) : void <static> Clears in the inner HTML content of a DOM element.
<static> Clears in the inner HTML content of a DOM element.
Parameters:
|
Utils | |
encodePath( String path ) : String <static> Encodes the specified path using encodeURI. Additionally +,
# and ? are encoded.
The following charact...
<static> Encodes the specified path using encodeURI. Additionally
Added in CQ 5.3.
+,
# and ? are encoded.The following characters are not encoded: 0-9 a-z A-Z- _ . ! ~ * ' ( ); / : @ & = $ ,
Parameters:
|
Utils | |
encodePathOfURI( String url ) : String <static> Encodes the path of the specified URL if it is not already encoded.
Path means the part of the URL bef...
<static> Encodes the path of the specified URL if it is not already encoded.
Path means the part of the URL before the first question mark or
hash sign.
Added in CQ 5.3.
See CQ.shared.HTTP.encodePath for details about the encoding. Sample: /x/y+z.png?path=/x/y+z >> /x/y%2Bz.png?path=x/y+zNote that the sample would not work because the "+" in the request parameter would be interpreted as a space. Parameters must be encoded separately.
Parameters:
|
Utils | |
eventWrapper( Function func ) : Function <static> Creates a event wraping function of a parameter function. Available parameters are:
event : ObjectEven...
<static> Creates a event wraping function of a parameter function. Available parameters are:
Parameters:
|
Utils | |
externalize( String url, [boolean encode] ) : String <static> Makes sure the specified relative URL starts with the context path
used on the server. If an absolute ...
<static> Makes sure the specified relative URL starts with the context path
used on the server. If an absolute URL is passed, it will be returned
as-is.
Added in CQ 5.3.
Parameters:
|
Utils | |
|
getContextPath() : String <static> Returns the context path used on the server.
<static> Returns the context path used on the server.
Added in CQ 5.3.
Parameters:
|
Utils | |
|
getPagePath() : String <static> Returns the current page path.
<static> Returns the current page path.
Parameters:
|
Utils | |
getPath( String url ) : String <static> Removes all parts but the path from the specified URL.
Examples:/x/y.sel.html?param=abc => /x/y
htt...
<static> Removes all parts but the path from the specified URL.
Examples:
Parameters:
|
Utils | |
|
getTimestamp() : Number <static> Returns a timestamp.
<static> Returns a timestamp.
Parameters:
|
Utils | |
|
getUID() : String <static> Returns a base 16 encoded UID based on a timestamp and a random number.
<static> Returns a base 16 encoded UID based on a timestamp and a random number.
Parameters:
|
Utils | |
insert( String str, Number every, String separator ) : String <static> Inserts a string every x character into another string.
<static> Inserts a string every x character into another string.
Parameters:
|
Utils | |
internalize( String url, [String doc] ) : String <static> Removes scheme, authority and context path from the specified
absolute URL if it has the same scheme a...
<static> Removes scheme, authority and context path from the specified
absolute URL if it has the same scheme and authority as the
specified document (or the current one).
Parameters:
|
Utils | |
load( String url, [Function callback] ) : void <static> Requests the specified URL from the server using GET. The request
will be synchronous, unless a callba...
<static> Requests the specified URL from the server using GET. The request
will be synchronous, unless a callback function is specified.
Parameters:
|
Utils | |
loadElement( String url, String elemId ) : void <static> Loads the HTML returned by a GET request into a DOM element.
<static> Loads the HTML returned by a GET request into a DOM element.
Parameters:
|
Utils | |
loadTeaserElement( String url, String elemId ) : void <static> Loads the HTML returned by a GET request into a DOM element. Teasers smooth loading.
<static> Loads the HTML returned by a GET request into a DOM element. Teasers smooth loading.
Parameters:
|
Utils | |
post( String url, [Function callback], Object params, Object scope ) : void <static> Requests the specified URL from the server using POST. The request
will be synchronous, unless a callb...
<static> Requests the specified URL from the server using POST. The request
will be synchronous, unless a callback function is specified.
The returned response object looks like this:
See constants above for all supported headers.
Parameters:
|
Utils | |
registerDocumentEventHandler( Object event, Function func ) : void <static> Attaches an event handler while properly considering (aka chaining) an existing one
<static> Attaches an event handler while properly considering (aka chaining) an existing one
Parameters:
|
Utils | |
removeAnchor( String url ) : String <static> Removes the anchor from the specified URL.
<static> Removes the anchor from the specified URL.
Parameters:
|
Utils | |
removeParameters( String url ) : String <static> Removes all parameter from the specified URL.
<static> Removes all parameter from the specified URL.
Parameters:
|
Utils | |