使用JS获取当前页面的URL(网址信息)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script>
var url;
url = window.location.href;
alert(url);
url = window.location.pathname;
alert(url);
url = window.location.protocol;
alert(url);
url = window.location.host;
alert(url);
url = window.location.hostname;
alert(url);
url = window.location.port;
alert(url);
url = window.location.hash;
alert(url);
url = window.location.search;
alert(url);
url = window.location.pathname;
url = url.substring(url.lastIndexOf('/') + 1, url.length);
alert(url);
var url = window.parent.frames['frame'].location.href;
var url = window.parent.location.href;
var url = parent.window.location.href;
</script>
</head>
<body>
</body>
</html>