<!DOCTYPE html>
<html>
<body>
<script>
document.write(location.href); //网页完整url
document.write(location.pathname); //当前路径url
</script>
</body>
</html>