Code Snippet: How to detect what browser is viewing the page

<script>
  var BROWSER_AGENT = navigator.userAgent.toLowerCase();
  if(BROWSER_AGENT.indexOf("msie") != -1) {
    //this browser is supported
  } else {
    //this browser is not supported
  }
</script>

 
(more…)

Code Snippet: Using Javascript to read the url in the address bar

<script language="javascript">
  var myURL = window.location.protocol; //returns 'http:'
  myURL += "//" + window.location.host; //returns 'http://www.sharepointdynamics.net'
</script>

 
(more…)