JS-Kit Rating and Comment

April 4th, 2007 in 因特网, 推荐荐 | 6 留言

Matt 推荐的这个 JS-Kit 真挺 cute,不需注册,在任何网页上加上很小一段 html 代码,就可以实现评分和评论功能。

评分:
<div class="js-kit-rating"></div>
<script src="http://js-kit.com/ratings.js"></script>

缺省效果:

阅读全文 »

关键词: , ,

用 JavaScript 模拟脚踏石模型

May 12th, 2006 in 科学 | 4 留言

我爱妞妞看到btsb的脚踏石模型帖子后,用 JavaScript 编了个模拟程序,看这儿。真是酷得没治了。

关键词: , ,

del.icio.us tagrolls

November 14th, 2005 in 闲话 | 5 留言

webleon 介绍了del.icio.us 新推出的功能:Tagrolls。很酷哦,

阅读全文 »

关键词: , ,

反恶劣网站的代码

October 27th, 2005 in 因特网 | 8 留言

陆续有一些恶劣的网站,像搜狐博粹,Bolaa等等,把别人的网页放框架里面,让众人为它们服务。Zola 介绍了一个 Javascript 代码,可以来骂骂他们。

var web = document.location;
if (top.location !== self.location) {

alert (“你现在访问的是”+web+”\n 检测到你使用框架浏览本站内容,本页即将跳转到创作共用约定页面。\n 请不要使用框架跨站调用本站内容。\n 请遵守Creative Commons协议。\n 授权方式为:署名 · 非商业用途 · 保持一致”);

//这个比较好,可以转到特定的页面提示一下.
this.location=”http://www.creativecommons.cn/licenses/by-nc-sa/1.0/”;
}

不过这样子跳转后,还是在他们的框架里面。可以把上面代码中的this.location换成top.location,这样就完全跳出了。你也可以把url部分删除,这样就跳到真实页面上来了。

if (top.location !== self.location) {

alert (“使用框架跨站调用它站内容是很丢脸的行为。\n 马上跳转到真实地址。”);

top.location=”";
}

如果觉得说也没用,可以简化到一句:

if (top.location !== self.location) {
top.location=”";
}

关键词: ,