当前位置: 首页 > 图文教程 > 网络编程 > Javascript > 点一下,首页地址添加到收藏夹(javascript)

Javascript
form中限制文本字节数js代码
use jscript with List Proxy Server Information
use jscript List Installed Software
List Installed Software Features
List Information About the Binary Files Used by an Application
List the Codec Files on a Computer
List the UTC Time on a Computer
List Installed Hot Fixes
excel操作之Add Data to a Spreadsheet Cell
Add Formatted Data to a Spreadsheet
Apply an AutoFormat to an Excel Spreadsheet
JavaScript语法着色引擎(demo及打包文件下载)
类之Prototype.js学习
一款JavaScript压缩工具:X2JSCompactor
iis6+javascript Add an Extension File
jscript之Open an Excel Spreadsheet
jscript之Read an Excel Spreadsheet
jscript之List Excel Color Values
去除图像或链接黑眼圈的两种方法总结
Add a Formatted Table to a Word Document

Javascript 中的 点一下,首页地址添加到收藏夹(javascript)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-08-10   浏览: 346 ::
收藏到网摘: n/a

  我们都希望自己辛苦制作的主页能够成为网友们的收藏夹中的东东,于是我们不停的用各种方法吸引网友的注意力,大声的告诉他们:“如果你觉得的好,就把我的主页填加到你的收藏夹中吧!”;“按CTRL+D把本站填加进您的收藏夹”……

其实我们不用那么费力气就可以达到一个更好的效果,呵呵,现在有一段代码,你可以使你通过点击一个连接就把主页地址添入收藏夹,怎么样?请看仔细:

首先在<head>与</head>之间加入如下代码:

<script language=javascript>
<!--
function Addme(){
url = "http://your.site.address"; //你自己的主页地址
title = "Your Site Name"; //你自己的主页名称
window.external.AddFavorite(url,title);
-->
</script>

然后,当然是然后,随便在您需要的地方做一个连接(您就看着该就行了),

<a href="javascript:Addme()">将本站添入收藏夹</a>

终于成功了,赶快实验一下吧!!!