title: HTML force URL hyperlink to be treated as non-relative (absolute)
body: <p>I have a list of URLs that our users have entered for websites of various clients... I am loading this list from the server into a grid for the users to see... I made the URLs clickable by wrapping them with a href HTML tag... the problem is, <strong>sometimes</strong> the user enters urls without the http:// or www. prefix and so the browser treats them as relative URLs which are never ever the case because all these websites are for our clients and they are all external. Is there a way to force these URLs to be treated as absolute instead of relative?</p>
  
  <p>Here is an example:</p>
  
  <pre><code>&lt;a target='_blank' href='google.com'&gt;google.com&lt;/a&gt;
  </code></pre>
  
  <p>If you try this, you'll see that the browser will assume it is a relative path which shouldn't be the case.</p>
  
  <p>Thanks</p>
  
  <hr>
  
  <p>Solution:</p>
  
  <p>I've chosen to check for '//' (because I don't know what the protocol is - could be http or https) and if not found, I assume it is an http website and I prefix the URL with that - so in short no way to force the browser to treat the hyperlinks as absolute</p>