Difference between revisions of "CR.url"

From Market Ruler Help
Jump to: navigation, search
Line 1: Line 1:
 
The '''__CR.URL''' function is a [[JavaScript]] function that parses the current URL. It returns a newly created URL object representing the URL defined by the parameters.  
 
The '''__CR.URL''' function is a [[JavaScript]] function that parses the current URL. It returns a newly created URL object representing the URL defined by the parameters.  
  
== Using CR.URL() ==
+
=== Using __CR.URL() ===
  
When you call CR.URL() it parses the current URL and the following structure is returned (data is included as part of this example).
+
When you call __CR.URL() it parses the current URL and the following structure is returned (data is included as part of this example).
 
     {protocol: "https", host: "addresslock.com", path: "/", hash: "", query: "", …}
 
     {protocol: "https", host: "addresslock.com", path: "/", hash: "", query: "", …}
  
Line 31: Line 31:
  
 
     [[File:addresslockhash.png]]
 
     [[File:addresslockhash.png]]
 
 
    hash: ""
 
    host: "addresslock.com"
 
    parse: ƒ (url)
 
    parseQuery: ƒ (q)
 
    path: "/"
 
    port:
 
    protocol: "https"
 
    query: ""
 
    queryParams: undefined
 
    queryparams: {}
 
    unparse: ƒ ()
 
    unparseQuery: ƒ ()
 
    url: "https://addresslock.com/"
 
    arguments: (...)
 
    caller: (...)
 
    length:
 
    name: ""
 
    prototype: {}
 
    __proto__: ƒ ()
 
    [[FunctionLocation]]:
 
    [[Scopes]]: Scopes[]
 
 
 
   
 
  
  

Revision as of 18:48, 24 June 2020

The __CR.URL function is a JavaScript function that parses the current URL. It returns a newly created URL object representing the URL defined by the parameters.

Using __CR.URL()

When you call __CR.URL() it parses the current URL and the following structure is returned (data is included as part of this example).

   {protocol: "https", host: "addresslock.com", path: "/", hash: "", query: "", …}
  • protocol: indicates which protocol the browser must use; typically for websites, it is "http" or "https"(its secured version).
  • host: returns the current domain; indicates which web server is being requested.
  • path: the path to the resource, starts with "/".
  • query: starts with "?", indicates parameters provided to the web server; parameters are listed in key/value pairs separated by the "&" symbol.
  • hash: anchor or fragment identifier, begins with "#"; it is an optional part of a URL that gives the browser directions to content at a "bookmarked" spot.
  • port: indicated by ":" and a number. It is the technical 'gate' used to access the resources on the web server. Port is usually omitted if the web server uses the standard ports of the HTTP protocol (80 for HTTP and 443 for HTTPS).

Note the changes that occur when you update query parameters in the following example using addresslock.com:

   Addresslock.png
   Addresslockquery.png
   Addresslockhash.png


See also


Category:ConversionRuler]] Category:ConversionRuler JavaScript Functions]]