jQuerify书签

作者:volcano 来源:某人的栖息地 时间:2008-06-16 12:16:00 

我不知道有多少人在使用浏览器的书签,这东东有时候实在是很有用的,比如现在说到的jQuerify书签

jQuerify书签的功能很简单,那就是在当前页面中直接载入jquery.js,并以一个粉红色的浮动层提示jquery已经载入。书签的源代码如下:


var s=document.createElement('script');
s.setAttribute('src','http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js');
if(typeof jQuery!='undefined') {
  var msg='This page was already jQuerified'
} else {
  document.getElementsByTagName('head')[0].appendChild(s);
  var msg='This page is now jQuerified'
}
var el=document.createElement('div');
  el.style.position='fixed';
  el.style.height='30';
  el.style.width='200';
  el.style.margin='0 auto 0 auto';
  el.id='jq-kswedberg';
  el.style.top='0';
  el.style.left='40%';
  el.style.padding='5px 10px 5px 10px';
  el.style.backgroundColor='#f99';
  el.innerHTML=msg;
var b=document.getElementsByTagName('body')[0];
b.appendChild(el);
window.setTimeout(function() {
  jQuery('#jq-kswedberg').fadeOut('slow',function() {
    jQuery(this).remove()
  });
}, 2500);
void(s); 

书签的链接在下边,如果是firefox的话,可以直接拖拽到firefox的书签栏上。

» jQuerify «

这里用到了最近说到的google cdn,速度可是足够快的。在使用书签之后,就可以尽情享受jquery的便利了,比如在firebug的console输入:

$('body').background('#ffc') 

你会看到屏幕的背景色变黄了:)

标签:jquery,书签,浏览器
0
投稿

猜你喜欢

  • 教你隐藏ACCESS数据库的表名

    2008-05-09 19:45:00
  • 网站重构 CSS样式表的优化技巧

    2009-05-12 11:51:00
  • 玩体验,先忘掉自己

    2010-01-30 13:36:00
  • ASP技巧 挂QQ的网页源代码ASP/PHP

    2009-01-05 12:36:00
  • 教学演示-UBB,剪贴板,textRange及其他

    2008-01-27 13:46:00
  • display:inline问题小结

    2008-05-01 13:08:00
  • fso怎样判断一个盘上是否有文件

    2007-09-26 12:35:00
  • 关于点击区域

    2009-07-24 13:08:00
  • js验证表单(form)中多选框(checkbox)值

    2008-03-18 13:39:00
  • 改进评论提交表单

    2009-03-25 20:37:00
  • 服务器安装MySQL教程及注意事项

    2008-11-11 12:12:00
  • 十“问”DreamWeaver

    2007-02-03 11:39:00
  • escape解决AJAX中文乱码的简单方法

    2008-10-23 14:32:00
  • 学习ASP.NET八天入门:第七天

    2007-08-07 13:52:00
  • HTML在线编辑器的原理分析(整理)

    2007-12-22 10:25:00
  • 基于jQuery实现的立体文字渐变效果

    2009-05-18 19:15:00
  • FileSystem对象常用的文件操作函数有哪些?

    2009-11-01 15:11:00
  • asp如何使用Office Chart 9.0 制作图表?

    2010-06-05 12:41:00
  • SQLServer 2005 实现数据库同步备份 过程-结果-分析

    2012-07-11 15:56:55
  • FileUpload上传图片预览不变形

    2010-08-05 21:25:00
  • asp之家 网络编程 m.aspxhome.com