我是javascript和jquery的新手.
$.getJSON("idcheck.php?callback=?", { url:  /*i want full url to be print*/ }, function(json){
  //alert(json.message);
});
如何在url之后获取当前的完整网址:在上面?
谢谢
mar*_*cgg 20
这将为您提供当前网址:
window.location.pathname
编辑:
$.getJSON("idcheck.php?callback=?", { url:  window.location.pathname }, function(json){
  //alert(json.message);
});
编辑2:使用PHP(找到通过)
<?php
function curPageURL() {
 $pageURL = 'http';
 if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
 $pageURL .= "://";
 if ($_SERVER["SERVER_PORT"] != "80") {
  $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
 } else {
  $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
 }
 return $pageURL;
}
?>
$.getJSON("idcheck.php?callback=?", { url:  "<?php echo curPageURL(); ?>" }, function(json){
  //alert(json.message);
});