- 浏览: 120733 次
- 性别:
- 来自: 深圳
-
文章分类
最新评论
//添加搜藏
function AddFavorite() {
var title = document.title;
var url = document.URL;
if (document.all) {
window.external.AddFavorite(url, title);
} else if (window.sidebar) {
window.sidebar.addPanel(title, url, "");
} else {
alert("加入收藏失败,请使用Ctrl+D进行添加");
}
}
// 设为首页
function setHomepage(vrl) {
if (document.all) {
document.body.style.behavior = 'url(#default#homepage)';
document.body.setHomePage(vrl);
} else if (window.sidebar) {
if (window.netscape) {
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
} catch (e) {
alert("该操作被浏览器拒绝,假如想启用该功能,请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true");
}
}
var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
prefs.setCharPref('browser.startup.homepage', 'http://www.finalcn.com');
}
}
jQuery:
$(document).ready(function () {
//添加到收藏夹
$("#favorites").click(function () { //$里面是链接的id
var ctrl = (navigator.userAgent.toLowerCase()).indexOf('mac') != -1 ? 'Command/Cmd' : 'CTRL';
if (document.all) {
window.external.addFavorite('http://www.baidu.com', '百度')
} else if (window.sidebar) {
window.sidebar.addPanel('百度', 'http://www.baidu.com', "")
} else { //添加收藏的快捷键
alert('添加失败\n您可以尝试通过快捷键' + ctrl + ' + D 加入到收藏夹~')
}
})
//设置主页
$("#addHomePage").click(function () {
if (document.all) {//设置IE
document.body.style.behavior = 'url(#default#homepage)';
document.body.setHomePage(document.URL);
} else {//网上可以找到设置火狐主页的代码,但是点击取消的话会有Bug,因此建议手动设置
alert("设置首页失败,请手动设置!");
}
})
});
function AddFavorite() {
var title = document.title;
var url = document.URL;
if (document.all) {
window.external.AddFavorite(url, title);
} else if (window.sidebar) {
window.sidebar.addPanel(title, url, "");
} else {
alert("加入收藏失败,请使用Ctrl+D进行添加");
}
}
// 设为首页
function setHomepage(vrl) {
if (document.all) {
document.body.style.behavior = 'url(#default#homepage)';
document.body.setHomePage(vrl);
} else if (window.sidebar) {
if (window.netscape) {
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
} catch (e) {
alert("该操作被浏览器拒绝,假如想启用该功能,请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true");
}
}
var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
prefs.setCharPref('browser.startup.homepage', 'http://www.finalcn.com');
}
}
jQuery:
$(document).ready(function () {
//添加到收藏夹
$("#favorites").click(function () { //$里面是链接的id
var ctrl = (navigator.userAgent.toLowerCase()).indexOf('mac') != -1 ? 'Command/Cmd' : 'CTRL';
if (document.all) {
window.external.addFavorite('http://www.baidu.com', '百度')
} else if (window.sidebar) {
window.sidebar.addPanel('百度', 'http://www.baidu.com', "")
} else { //添加收藏的快捷键
alert('添加失败\n您可以尝试通过快捷键' + ctrl + ' + D 加入到收藏夹~')
}
})
//设置主页
$("#addHomePage").click(function () {
if (document.all) {//设置IE
document.body.style.behavior = 'url(#default#homepage)';
document.body.setHomePage(document.URL);
} else {//网上可以找到设置火狐主页的代码,但是点击取消的话会有Bug,因此建议手动设置
alert("设置首页失败,请手动设置!");
}
})
});
发表评论
-
弹出层并可拖拽
2016-09-21 14:59 0<!DOCTYPE html PUBLIC " ... -
标题栏新消息提示效果
2016-09-21 14:42 536var newMessageRemind={ _step: ... -
JS转换HTML转义符
2016-09-21 14:14 564//去掉html标签 1 2 3 function remo ... -
JS判断是否在微信浏览器打开
2016-09-21 14:07 470最近做很多HTML5的项目,很多页面会通过微信微博等SNS分享 ... -
jQuery 发送验证码倒计时按钮
2016-09-21 11:02 550{ wait:90, hsTime:func ... -
JS杂记
2011-10-24 15:09 714//定义数组 var index = new ... -
数_函_置_内_J_S
2011-09-15 13:41 601http://mamaoyuan625.iteye.com/b ... -
素_元_建_创_J_S
2011-09-15 11:22 499//获取对象 var obj = document.getEl ... -
件_事_出_退_载_加_S_J
2011-09-01 14:45 599<html> <head> & ... -
组_数_S_J
2011-09-01 14:43 630<html> <head> &l ... -
点_节_形_树_S_J
2011-08-29 10:12 614http://wangyalei.iteye.com/blog ... -
层_级_展_示
2011-08-27 12:01 464<html> <head> &l ... -
巧_技_小_S_J
2011-08-26 10:17 362http://bageer707.iteye.com/blog ... -
2_数_函_串_符_字_用_常
2011-08-26 10:01 319//修改日期信息 myDate.setDate(myD ... -
1_数_函_串_符_字_用_常
2011-08-26 09:59 358//定义数组的两种方式 ... -
象_对_D_O_M
2011-08-26 09:55 443<html> <head> &l ... -
2_证_验_S_J
2011-08-25 12:42 388//验证电话号码 function checkPhone ... -
证_验_S_J
2011-08-25 12:35 512<html> <head> &l ... -
1_篇_础_基_S_J
2011-08-25 09:51 453http://www.iteye.com/topic/5656 ... -
传_上_片_图_S_J
2011-08-24 17:00 593http://www.cnblogs.com/cloudgam ...
相关推荐
如果想保存快照,可以添加到搜藏。 (百度和网页http://blog.csdn.net/mygodsos/archive/2008/10/19/3097921.aspx的作者无关,不对其内容负责。百度快照谨为网络故障时之索引,不代表被搜索网站的即时页面。) -----...
对于那些值得反复阅读或者参考的新闻,用户可以将其添加到收藏夹,方便日后查找。这有利于信息的长期存储和管理,提高了新闻阅读的效率。 4. **分享功能** 客户端内置了多种社交分享渠道,如微信、QQ、微博等,...
3. **收藏夹推广法**:将网店的优质内容添加到QQ书签、百度搜藏等收藏平台,让更多人通过收藏看到网店信息。 4. **版主联盟推广法**:参与论坛社区,提交高质量内容到版主联盟,提高曝光度,吸引流量。 5. **回复...
- **查找允许链接的版块**:一些论坛设有专门用于发布外部链接的版块。 - **建立论坛记录表**:记录每个论坛的信息,便于跟踪管理。 #### 三、友情链接交换 - **重要考量因素**: - 对方站点的信誉度和质量。 ...
1. **避免直接添加链接**:直接在帖子中添加链接可能会被视为广告行为,容易被管理员删除。 2. **利用论坛签名**:大多数论坛允许用户设置个人签名,可以在此处添加网站链接。 3. **寻找广告专区**:部分论坛设有...