Getting current URL using Jquery
问题 I am very new in javascript and jquery. $.getJSON("idcheck.php?callback=?", { url: /*i want full url to be print*/ }, function(json){ //alert(json.message); }); How do i get current full url on page on after url: in above? Thank you 回答1: This will give you the current url: window.location.pathname edit: $.getJSON("idcheck.php?callback=?", { url: window.location.pathname }, function(json){ //alert(json.message); }); edit 2: Using PHP (found via) <?php function curPageURL() { $pageURL = 'http';