Difference between revisions of "CR.url"

From Market Ruler Help
Jump to: navigation, search
Line 6: Line 6:
 
     {protocol: "https", host: "addresslock.com", path: "/", hash: "", query: "", …}
 
     {protocol: "https", host: "addresslock.com", path: "/", hash: "", query: "", …}
  
''"protocol"'': the type of protocol. In this case, "Hypertext Transfer Protocol"  
+
*'''''"protocol"''''': indicates which protocol the browser must use; typically for websites, it is "http" or "https"(its secured version)
  
''"host"'': returns the current domain
+
*'''''"host"''''': returns the current domain, indicates which web server is being requested
  
''"path"'': the path, starting with "/"
+
*'''''"path"''''': the path, starting with "/"
  
''"hash"'': fragment identifier, begins with "#"; it is the optional last part of a URL
+
*'''''"hash"''''': fragment identifier, begins with "#"; it is the optional last part of a URL
  
''"query"'': the things that come after the "?"
+
*'''''"query"''''': the things that come after the "?"
  
 
When you update queryparams, the following changes result:
 
When you update queryparams, the following changes result:

Revision as of 14:26, 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, starting with "/"
  • "hash": fragment identifier, begins with "#"; it is the optional last part of a URL
  • "query": the things that come after the "?"

When you update queryparams, the following changes result:

Sample page x

Sample page y

   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[]




See also


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