.net中添加收藏和设为首页的代码(转)

<a href="javascript:window.external.addFavorite(‘http://www.vkesoft.com‘,‘你的网站名字‘)">   <span style="font-size: 10pt">加入收藏</span></a>

<a href="Default.aspx" onclick="this.style.behavior=‘url(#default#homepage)‘;this.setHomePage(‘http://www.vkesoft.com‘)">
<span style="font-size: 10pt">设为首页</span></a>
1:设为首页
<a href="javascript:void(0);" id="setHomePage" onclick="this.style.behavior=‘url(#default#homepage)‘;this.setHomePage(‘http://www.vkesoft.com/‘);return(false);" style="behavior:url(#default#homepage);">设为主页</a>
 2:收藏本站
<span  style="CURSOR:hand" onclick="window.external.addFavorite(‘http://www.vkesoft.com‘,‘开宝网‘)">收藏本站</span>

3:不同浏览器,收藏的js代码有区别,比如IE和firefox等。

<a href=http://www.vkesoft.com onclick="window.external.addFavorite(this.href,this.title);return false;" title=‘vkesoft‘ rel="sidebar">加入收藏</a>

所有浏览器通用的js添加收藏夹代码

<script>

function addfavorite()
{
   if (document.all)
   {
      window.external.addFavorite(‘http://www.XXX.com‘,‘XXX);
   }
   else if (window.sidebar)
   {
      window.sidebar.addPanel(‘XXX, ‘http://www.XXX.com‘, "");
   }
}
</script>
<a href="#" onclick="addfavorite()">XXX</a>

打开,另存为,属性,打印&quot;等14个JS代码

■刷新■

■导入收藏■

■导出收藏■

■整理收藏夹■

■查看原文件■

■语言设置■

■打开■

<input name=Button onClick=document.all.WebBrowser.ExecWB(1,1) type=button value=打开>

<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>

■另存为■

<input name=Button onClick=document.all.WebBrowser.ExecWB(4,1) type=button value=另存为><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>

■属性■

<input name=Button onClick=document.all.WebBrowser.ExecWB(10,1) type=button value=属性><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>

■打印■

<input name=Button onClick=document.all.WebBrowser.ExecWB(6,1) type=button value=打印><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>

■页面设置■

<input name=Button onClick=document.all.WebBrowser.ExecWB(8,1) type=button value=页面设置><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>

■刷新■

<input type=button value=刷新 name=refresh onclick="window.location.reload()">

■导入收藏■

<input type="button" name="Button" value="导入收藏夹" onClick=window.external.ImportExportFavorites(true,);>

■导出收藏■

<input type="button" name="Button3" value="导出收藏夹" onClick=window.external.Imp

时间: 2024-08-11 12:55:34

.net中添加收藏和设为首页的代码(转)的相关文章

加入收藏和设为首页

// 设置为主页  function SetHome(obj,vrl){  try{  obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);  }  catch(e){  if(window.netscape) {  try {  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");  }  catch (e) { 

ASP.NET中怎样将页面设为首页,加入收藏

1.文字js脚本事件:<span onClick="var strHref=window.location.href;this.style.behavior=’url(#default#homepage)’;this.setHomePage(‘http://www.unvs.cn’);" style="CURSOR: hand"> 2.文字链接事件:<a href="#" onClick="window.externa

原生JavaScript加入收藏夹 设为首页

设为首页: function setHomepage() { if (document.all) { document.body.style.behavior = 'url(#default#homepage)'; document.body.setHomePage('http://paidad.cn') } else if (window.sidebar) { if (window.netscape) { try { netscape.security.PrivilegeManager.ena

加入收藏和设为首页的功能

<a onclick="SetHome(window.location)" href="javascript:void(0)">设为首页</a> <a onclick="AddFavorite(window.location,document.title)" href="javascript:void(0)">加入收藏</a> //加入收藏 function AddFavorit

javascript设为首页、加入收藏

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> *{margin: 0; padding: 0} a{text-decoration: none; color: #fff; font-size

Javascript 设为首页 + 加入收藏(全兼容)

//加入收藏夹 function AddFvtgc() { var title = document.title; var url = document.location.href; try { window.external.AddFavorite(url, title); } catch (e) { alert("请按下 Ctrl + D 键将本站加入收藏."); } } //设为首页 function AddHomegc() { var url = document.locati

网页中最常用的JS代码(js禁止右键、禁止复制,设为首页,加入收藏代码)

<body oncontextmenu=”return false”></body> <!– 禁用右键: –> <script> function stop(){ return false; } document.oncontextmenu=stop; </script> <body onselectstart=”return false”> 取消选取.防止复制 oncopy=”return false;” oncut=”return

设为首页 添加到收藏夹 (share)

设为 设为首页 和 收藏本站js代码 兼容IE,chrome,ff <script type="text/javascript"> //设为首页 function SetHome(obj,url){ try{ obj.style.behavior='url(#default#homepage)'; obj.setHomePage(url); }catch(e){ if(window.netscape){ try{ netscape.security.PrivilegeMan

设为首页、添加收藏

<!DOCTYPE html><html><head lang="en"> <meta charset="UTF-8"> <title></title></head><body><a href="javascript:void(0);" onclick="SetHome(this,'http://www.xyz.com');"