$(location).attr('href'); // http://www.refulz.com:8082/index.php#tab2 $(location).attr('pathname'); // index.php