问答详情
源自:8-11 Location对象

使用location.方法的时候不显示


 <script type="text/javascript">


// 对象属性

    // location.href  :获取当前网页的 URL

     document.write("<br>"+"1:"+location.href);


     document.write("<br>"+"2:"+location.hostname);

     document.write("<br>"+"3:"+location.host);

     document.write("<br>"+"4:"+location.hash);

     document.write("<br>"+"5:"+location.pathname);

     document.write("<br>"+"6:"+location.protocol);

     document.write("<br>"+"7:"+location.search);


//  对象方法:(为什么不显示呢)

     document.write("<br>"+"12:"+location.assign());

     document.write("<br>"+"13:"+location.reload());

     document.write("<br>"+"14:"+location.replace());


 </script>


提问者:yjyjyjyjyj 2021-02-20 15:00

个回答

  • weixin_慕码人0405103
    2022-05-06 08:09:29

    后面三个方法对窗口一顿操作,而且还有参数,你这……

  • 不爱学习的小五
    2021-09-23 09:53:41

    你把他粘到你自己的编译器试试

    搜索

    复制