• 关于JavaScript浏览器对象


     1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     2 <html xmlns="http://www.w3.org/1999/xhtml">
     3 <head>
     4 <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
     5 <title>自定义导航</title>
     6 <script type="text/javascript">
     7     function display(index){
     8          switch(ind){
     9              
    10              case 1:
    11              window.frames["index"].location.href = "https://www.baidu.com";
    12              break;
    13              
    14              case 2:
    15              window.frames["index"].location.href = "http://www.ijinshan.com/sem/xintop/f31.shtml?sfrom=166&keyID=1653";
    16              break;
    17              
    18              case 3:
    19              window.frames["index"].location.href = "http://www.ijinshan.com";
    20              break;
    21              }
    22         }
    23 </script>
    24 </head>
    25 <body>
    26     <a href="javascript:history.forward();">前进</a>
    27     <a href="javascript:history.back();">后退</a>
    28     <a href="javascript:history.go(0);">刷新</a>
    29     <p>
    30     <input type="button" value="第一个页面" onclick="display(1)"/>
    31     <input type="button" value="第二个页面" onclick="display(2)"/>
    32     <input type="button" value="第三个页面" onclick="display(3)"/>
    33     </p>
    34     <iframe src="https://www.baidu.com" name="ind" width="1300px" height="800"/>
    35 </body>
    36 </html>
    自定义导航
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>window对象</title>
    <script type="text/javascript">
        function change(){
            var myconfirm = confirm("英雄可以吗?");
            if(myconfirm){
                document.getElementById("info").style.fontWeight = "bold";
                document.getElementById("info").style.color = "#999";
                }
            }
            
        function myprompt(){
            var name = prompt("what's your name ?","请输入");
            document.write("名字:"+name+"<hr/>");
            }
    </script>
    </head>
    <body style="font-size:14px">
        <input type="text" id="info" value="德玛西亚" />
        <input type="button" value="亚瑟" onclick="change()"/>
        
        <input type="button" value="问名" onclick="myprompt()"/>
    </body>
    </html>
    window对象
    准备太多 不如行在路上 如有指教及代码错误请消息或邮件397599682@qq.com,欢迎讨论
  • 相关阅读:
    HDU 3401 Trade
    POJ 1151 Atlantis
    HDU 3415 Max Sum of MaxKsubsequence
    HDU 4234 Moving Points
    HDU 4258 Covered Walkway
    HDU 4391 Paint The Wall
    HDU 1199 Color the Ball
    HDU 4374 One hundred layer
    HDU 3507 Print Article
    GCC特性之__init修饰解析 kasalyn的专栏 博客频道 CSDN.NET
  • 原文地址:https://www.cnblogs.com/degui/p/9022231.html
Copyright © 2020-2023  润新知