zdg/
共68个网摘 [
1 2 3 ]
下一页 |
访问zdg的个人空间
zdg收录,使用标签:Javascript,时间:2008-2-25 19:25:17 | 相关网摘,我也收藏
最重要的一点是,不要污染当前网页的命名空间,否则可能会破坏当前网页的 JavaScript. 通常,可以使用闭包来隐藏你所有的变量。同样,如果您的 bookmarklet 的 CSS 可能会入侵当前网页(很遗憾,CSS 没有命名空间,也没有类似闭包的东西,很容易就会冲突),那么请考虑将 bookmarklet 的内容放到 iframe 中去。
其次,防止函数执行后不经意的副作用,一个比较好用的贴士是,使用不返回值的 void, 它可以接受任何参数,因此,把你的闭包放到 void 中是个不错的主意
目前世界上最流行的浏览器,IE6, 它对 bookmarklet 所能容忍的长度仅为 508!
http://realazy.org/blog/2008/02/25/bookmarklet/
zdg收录,使用标签:javascript, Taobao, AD,时间:2008-2-17 20:24:58 | 相关网摘,我也收藏
原来taobao发现如果不能自动的弹出窗口,就把弹窗口的函数邦到document.body的onclick事件面上去。这样一来只要用户一点击页面的任何位置,就会触发window.open弹出广告。当然这个时候的window.open就不是脚本自动触发的了,而是用户手动触发,在友好的拦截器下,这是合理的open。这个不是taobao最高明的地方,接下来的adPopup.blur();和adPopup.opener.focus();才是精华!
设计这个弹出窗口的人也深知,咣一下来个弹出窗口广告非常的不友好,八层也不被大家伙接受。所以taobao的弹出窗口非常的低调,弹出来以后自己立即就躲在后面去了,这时除了任务栏上多了一个IE的任务和有音响的机器会发出一个提示音外,对用户浏览taobao来说没有任何影响。接下来用户买完东西关闭taobao的浏览器才会看到,怎么有个广告窗口呢?难道是自己什么时候不小心点出来的?如果正好感兴趣就看两眼,不敢兴趣就关闭它,也不会多想。而且taobao做了优化,cookie里有记录,这个首页的弹出窗口一天只会弹一次。
http://www.cnblogs.com/birdshome/archive/2007/12/22/window-open.html
zdg收录,使用标签:Javascript,时间:2008-1-18 19:23:41 | 相关网摘,我也收藏
很多时候我们做web开发往cookie里面存数据,只是为了在不同的网页之间跳转的时候可以共享数据,但是cookie里面的每个数据不管是否需要都会在每个同域的http请求中被发送往服务器,包括每个页面、图片、css、脚本或者ajax的的请求,这就无形中占用了多余的带宽。更糟糕的是,一个网页的cookie本来也只有有限的4k空间,一旦不小心写入的cookie超过了限制,就会造成原来有用的cookie丢失,这样造成的bug非常难以追查。
因此我们在IE下面经常使用userdata来保存共享数据。但是在firefox下面却一直缺乏对应的特性。
今天在看firefox 2.0的what's new 的时候,惊奇的发现一个新特性叫做:
Support for client-side session and persistent storage
赶紧试验了一下,firefox2.0果然支持这个特性了。虽然还只能在session生命周期内使用(而不像ie的userdata可以指定有效时间),但是总算解决了cookie占用的问题了。
http://www.blogjava.net/emu/archive/2006/10/04/73385.html
zdg收录,使用标签:facebook, Beacon, Javascript,时间:2007-11-27 23:30:24 | 相关网摘,我也收藏
This post is an in-depth look at Beacon, and is broken down into a few sections to make it easier for you to navigate:
* Beacon in a Nutshell: an overview of Beacon and a visual tour of the user interface elements
* Beacon from 10,000 Feet: a look at the technology behind Beacon from way up high. Read this if you don't want the finer details but do want an idea of how it works.
* Blocking Beacon: if you're concerned about privacy and want to stop Beacon, check this part out.
* Walking through the Code: this is the section for you if you're the type of person who loves reading code listings and wants to know exactly what makes it tick.
Allow your customers to share with their friends the actions they take on your website. For user actions you define, Facebook Beacon will publish a story in the user's profile and to friends' News Feeds with a link back to your site.
http://www.radiantcore.com/blog/archives/23/11/2007/deconstructingfacebookbeaconjavascript
zdg收录,使用标签:Javascript, WebDesign,时间:2007-9-16 22:27:06 | 相关网摘,我也收藏
在办公室里,我们常常会问:“还记得没有Firebug时怎么过么?”它确实改变了我的生活。其主要好处如下:
* 检阅DOM
点击“Inspect”,然后鼠标放到页面元件上,就能看到此元件的HTML和CSS代码。
* 显示样式继承的实时CSS编辑
简直就是钱啊——这大大节省了布局设计的时间。例如,在Firebug里可以选择一个DIV标记,点击margin属性后手工调整,上下键为加减1个像素,上下翻页键为加减10个像素。(htmlor注:任何数值属性都可以这样调整) 还可以在当前样式添加新属性。效果满意之后,再把修改的CSS代码贴到实际文件中去。
* 详尽的Javascript调试
这里的JS控制台比Firefox自带的稍好。它更详尽,是默认控制台不错的替代品。
* 查看页面加载的所有文件及总字节数
对于优化站点加载时间来说,这很关键。你可以测试单个文件会加载多久,图片,JS文件,AJAX调用等。在“Net”部分的最后一行,可以看到页面加载文件的总字节数。
http://blog.htmlor.com/2007/09/11/10_tips_for_programmers_and_designers/
zdg收录,使用标签:Javascript, ajax,时间:2006-12-16 15:13:36 | 相关网摘,我也收藏
I made a list of the top 10 libraries that I have come across or that I personally use. Libraries can be best for a web developers friend. They are great resources to learn from and can save hours and hours of time. These libraries include JavaScript, Ajax, Colors, PHP, and CSS. These should be in any web developers bookmarks, so go ahead and look through these libraries and bookmark your favorite ones. The list is in no particular order.
http://ashko.blogspot.com/2006/11/best-top-ten-open-sourceajaxdhtml.html
zdg收录,使用标签:jQuery, Javascript, ajax,时间:2006-10-30 22:40:21 | 相关网摘,我也收藏
jQuery is a Javascript library that takes this motto to heart: Writing Javascript code should be fun. jQuery achieves this goal by taking common, repetitive, tasks, stripping out all the unnecessary markup, and leaving them short, smart and understandable.
http://jquery.com/
zdg收录,使用标签:Javascript, effect,时间:2006-10-30 22:25:48 | 相关网摘,我也收藏
Fireworks.js is a bit of Javascript that creates starburst-type explosions in a web document; in short, it's a fireworks effect someone could theoretically use on their site. And come on, who doesn't want something like that? As far as appropriateness is concerned, this effect could be compared to the dripping-blood-line, skull and fireball animated .GIF images so popular on the web in 1997. Exploding firework animations are hot, the new black, the script equivalent of the blink tag. Mmm, blink tag.
http://www.schillmania.com/projects/fireworks/
zdg收录,使用标签:Javascript,时间:2006-10-11 5:34:09 | 相关网摘,我也收藏
JavaScript is a fully-featured Object-Oriented programming language, on the surface, it shares syntactical similarities with Java and C, but the mentality is quite different, at its core, JavaScript is more similar to functional languages. Inside is a list of JavaScript tips, some offer techniques to simulate features found in C-like languages (such as assertions or static variables), others are meant to improve performance and explore some of the more obscure parts of the web scripting language.
http://aymanh.com/9-javascript-tips-you-may-not-know
共68个网摘 [
1 2 3 ]
下一页