Difference between revisions of "CR.url"

From Market Ruler Help
Jump to: navigation, search
(Created page with "<code>__CR.url</code> is a member in the ConversionRuler JavaScript Global, and is of type <code>string</code>. It contains the URL of the current page. In the example be...")
 
Line 1: Line 1:
<code>__CR.url</code> is a member in the [[ConversionRuler JavaScript Global]], and is of type <code>string</code>. It contains the URL of the current page.
+
The '''__CR.url''' function is a [[JavaScript]] function and returns the following:
 +
 
 +
hash: ""
 +
host: ""
 +
parse: ƒ (url)
 +
parseQuery: ƒ (q)
 +
path: ""
 +
port:
 +
protocol: ""
 +
query: ""
 +
queryParams:
 +
queryparams: {}
 +
unparse: ƒ ()
 +
unparseQuery: ƒ ()
 +
url: ""
 +
arguments: (...)
 +
caller: (...)
 +
length:
 +
name: ""
 +
prototype: {}
 +
__proto__: ƒ ()
 +
[[FunctionLocation]]:
 +
[[Scopes]]: Scopes[]
  
In the example below, the URL string is converted to lower case letters.
 
  
Example usage:
 
<script>
 
if (
 
    cr.URL().path.toLowerCase().indexOf('/thank-you'.toLowerCase()) === 0
 
) {
 
</script>
 
  
  
 
== See also ==
 
== See also ==

Revision as of 14:47, 22 June 2020

The __CR.url function is a JavaScript function and returns the following:

hash: "" host: "" parse: ƒ (url) parseQuery: ƒ (q) path: "" port: protocol: "" query: "" queryParams: queryparams: {} unparse: ƒ () unparseQuery: ƒ () url: "" arguments: (...) caller: (...) length: name: "" prototype: {} __proto__: ƒ () FunctionLocation: Scopes: Scopes[]



See also