网站首页  汉语字词  英语词汇  考试资料  写作素材  旧版资料

请输入您要查询的考试资料:

 

标题 JavaScript把网站设为首页代码大全
内容
    JavaScript把网站设为首页代码大全。
    1.鼠标指向时提示设为首页,将下列代码插入<body>区中:
    <a href=http://www.173it.cn onmouseover="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.173it.cn');" target="_blank">设为首页</a>
    2.设为首页代码,加入收藏夹,把以下代码加入<Body>相应位置:
    <a target=_top href="javascript:window.external.addFavorite('http://www.173it.cn','网页教学网');">加入收藏</a>
    <a href='#' onClick="this.style.behavior='url(#default#homepage)'; this.setHomePage('http:/www.173it.cn');">设为首页</a>
    3.打开页面时自动弹出窗口询问是否设为首页,将以下代码放在<head></head>之间:
    <script language="javascript">
    function myhomepage(){
    this.homepage.style.behavior='url(#default#homepage)';this.homepage.sethomepage('http://www.173it.cn');
    }
    </script>
    <p><a href=http:/www.173it.cn name="homepage"
    onclick="myhomepage();"></a>
    再将下面代码加入<body>内:
    onload="myhomepage();"
    即:<body onload="myhomepage();">
    4.离开时自动提示设为首页,替换<body>标签为:
    <body onunload="BASEBody.style.behavior='url(#default#homepage)';if(!(BASEBody.isHomePage('http://www.173it.cn')))BASEBody.setHomePage('http:/www.173it.cn/');">
随便看

 

在线学习网考试资料包含高考、自考、专升本考试、人事考试、公务员考试、大学生村官考试、特岗教师招聘考试、事业单位招聘考试、企业人才招聘、银行招聘、教师招聘、农村信用社招聘、各类资格证书考试等各类考试资料。

 

Copyright © 2002-2024 cuapp.net All Rights Reserved
更新时间:2025/5/14 7:44:34