Knowledge Drop

How are relative URLs in the link/html parameter handled? (url = "/explore...", etc.)

  • 7 July 2021
  • 0 replies
  • 30 views

Userlevel 4

Last tested: Aug 23, 2019
 

To understand how relative URLs in the link/html parameter are handled, it is helpful to understand how relative URLs work in browsers in general. This stackoverflow post has a detailed description of the different types of relative URLs and how they work, but the basic rules are as follows:

  1. If there are two leading slashes, it is scheme relative
  2. If there is one leading slash, it is root relative
  3. If there is no leading slash, but there is a colon, assume it is an absolute URI
  4. If there is no leading slash, and no colon, it is location relative

Examples: Suppose that you are navigating from https://example.looker.com/explore/model1/explore1?qid=[query hash].

  1. Scheme relative: url: "//foo" will navigate to https://foo
  2. Root relative: url: "/foo" will navigate to https://example.looker.com/foo
  3. Absolute URI: url: "fo:o" will navigate to fo:o
  4. Location relative: url: "foo" will navigate to https://example.looker.com/explore/model1/foo

 

This content is subject to limited support.                

 

 


0 replies

Be the first to reply!

Reply