zoukankan      html  css  js  c++  java
  • location 位置

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title></title>
    </head>
    <button type="button" onclick="newDoc()">加载新文档</button>
    <br />
    <body>
    <script>
    document.write('输出当前位置的路径:');
    document.write(location.href);
    document.write('</br>');
    document.write('输出当前位置的端口:');
    document.write(location.port);
    document.write('</br>');
    document.write('输出当前位置的协议:');
    document.write(location.protocol);
    document.write('</br>');
    document.write('输出web主机的域名:');
    document.write(location.hostname);
    document.write('</br>');
    document.write('返回单前页面的路径和文件名:');
    document.write(location.pathname);
    document.write('</br>');
    function newDoc(){
    document.location.assign('http://www.zhaocom.xyz');
    }
    </script>
    </body>
    </html>

  • 相关阅读:
    最小生成树
    图论最短路径例题
    广搜例题
    这些搜索套路好深。。。
    高斯消元part2
    高斯消元与行列式求值 part1
    2020/4/24
    实时的眼部追踪
    2020/4/23
    2020/4/22
  • 原文地址:https://www.cnblogs.com/zhaocom/p/8742964.html
Copyright © 2011-2022 走看看