专著于富媒体技术~
本站某些作品来源于互联网,如果侵犯了您的利益,请留言说明

相关文章:

常用的Javascript代码(一)

收藏本站

以下为引用的内容:
<span style="CURSOR: hand" onClick="window.external.addFavorite('http://www.niuc.net','牛C网')" title="牛C网">收藏本站</span>

或:

以下为引用的内容:
<script Language="JavaScript">
  function bookmarkit()
  {
  window.external.addFavorite('http://www.niuc.net','牛C网')
  }
  if (document.all)document.write('<a href="#" onClick="bookmarkit()">加入收藏夹</a>')
  </script>
  

通用的加入收藏夹  

以下为引用的内容:
<script type="text/javascript">
// <![CDATA[
function bookmark(){
var title=document.title
var url=document.location.href
if (window.sidebar) window.sidebar.addPanel(title, url,"");
else if( window.opera && window.print ){
var mbm = document.createElement('a');
mbm.setAttribute('rel','sidebar');
mbm.setAttribute('href',url);
mbm.setAttribute('title',title);
mbm.click();}
else if( document.all ) window.external.AddFavorite( url, title);
}
// ]]>
</script>  
<a href="javascript:bookmark()">加入收藏夹</a>
  

在IE6-7. FF2.0 OP9.0中测试通过  

设为首页  

以下为引用的内容:
<span onclick="var strHref=window.location.href;this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.niuc.net');" style="CURSOR: hand">设为首页</span>
  

返回页首

以下为引用的内容:

<img src="/imgs/top.gif" onClick="javascript:document.location='#top'" style="cursor:pointer;">

  

相关文章列表:

常用的JavaScript代码(五)
常用的JavaScript代码(四)
常用的JavaScript代码(三)
常用的Javascript代码(二)
常用的Javascript代码(一)

            


作者:gdgzboy@牛C网
地址:http://www.niuc.net/post/665/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!



发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]
               

验证码 不区分大小写