How to get URL’s & Querystrings using jQuery
URL = http://www.domain.com/post.aspx?postid=39&posttype=General 1. Get the current URL in jQuery var currentURL = document.URL; Result : http://www.domain.com/post.aspx?postid=39&posttype=General ------------------------------------------------------------------ var currentURL = window.location.href; Result : http://www.domain.com/post.aspx?postid=39&posttype=General ------------------------------------------------------------------ 2.Get the pathname var currentURL = location.pathname; Result : post.aspx?postid=39&posttype=General ------------------------------------------------------------------ 3.Get the hostname var currentURL = location.hostname; Result : www.domain.com ------------------------------------------------------------------ 4.Get A URL Hash Parameter var currentURL = location.hash; Result : null ------------------------------------------------------------------ 5.Read Querystring Parameters function GetQueryStringParams(sPar...