关♥生活,关注互联网。
学习笔记
如何编写优质的网站代码[译]
11月 22nd
Writing semantic, efficient and valid HTML and CSS can be a time-intensive process that only gets better with experience. While it is important to take the time to produce high-quality code — as it is what separates professionals from hobbyists — it is equally important to produce websites as expeditiously and efficiently as possible.
编写语义化、高效而又符合规范的HTML和CSS代码不仅要花费大量时间还需要丰富的经验。但为了产生优质代码而投入时间是值得的——代码质量可以体现业余爱好者与专业人士之间的区别——这与快速高效地完成网站建设同样重要。 More >
调用Google Maps API实现HTML5 Geo定位
11月 20th
HTML5进入人们视线的时间并不长,但我们已经能看到浏览器变得更强大,应用也变得越具智能。充分利用HTML5的新特性能使我们的生活更加便利。这儿就有一个例子——我们结合HTML5技术和地图应用接口来实现定位。
该应用可兼容的浏览器包括:Opera,Chrome, FireFox,Safari。以及……偶滴U8110自带浏览器(Safari Mobile)上测试通过。
15个提高WordPress博客速度的技巧[译]
11月 18th
网络上关于WordPress提速优化的文章已是数不胜数,这里也译一篇来凑凑热闹,毕竟网站的优化在怎么提也不过分,大概没有人会嫌自己的网站加载过快吧。
Slow WordPress Blogs turn everyone off – Google doesn’t like sites that load slowly, and readers have to impatiently wait to read your brilliant material. In that waiting time, they might even click that back button. Fast-loading websites and blogs are a necessity in the impatient information age.
反应慢的WordPress博客会让访客们扫兴—Google也不喜欢加载速度慢的网站,读者常常为了一览你的风采必须经历无奈的等待。在等待的过程中,他们甚至可能点击关闭按钮。博客网站的加载速度在这信息爆炸的时代显得更加重要。 More >
另外15个让你Feel Stupid的谷歌面试问题
11月 13th
- Every wife in the village instantly knows when a man other than her husband has cheated, but does not know when her own husband has. The village has a law that does not allow for adultery. Any wife who can prove that her husband is unfaithful must kill him that very day. The women of the village would never disobey this law. One day, the queen of the village visits and announces that at least one husband has been unfaithful. What happens?
- If the probability of observing a car in 30 minutes on a highway is 0.95, what is the probability of observing a car in 10 minutes (assuming constant default probability)? More >
Mac上的30个最佳Web开发工具
11月 5th
苹果的东西总有股神秘的力量令一批用户深深地为其着迷,i系列产品尤其受到web设计者们的青睐,其中不乏最优秀的设计师。除了精致的外型和超前的设计理念外,其中很大一部分原因在于苹果的产品使得人们花较少的功夫就能够搭建起便于设计的环境,下面就全文转发一篇介绍Mac上的30个最佳Web开发工具的文章:
Mac OS X are well know for their simplicity and performance. If you’re a web developer who’s using a Mac, then chances are you’ve come across at least one the popular development tools for a Mac. Finding Useful Mac Apps For Freelance Web Designers was one challenging task. In this post you will find 30 Best Mac Apps designed for code editing, file and data transfer, collaboration, database management, image editing, invoicing, time tracking, expenses tracking and much, much more. Most of them are relatively inexpensive and almost all of them offer a free trial period. More >
JavaScript 框架
11月 1st
由于不同 Web 浏览器所支持DOM标准版本不尽相同,与 HTML 和 CSS一样,不同的浏览器有不同的 JavaScript 实现方式。这使得早期 JavaScript 代码实现跨浏览器兼容成为一场噩梦。
就拿网站右下角常见的浮动提示框举例:
- 首先,必须通过判断
getElementById()
方法存在与否来决定是用document.getElementById(“floater”).style还是document.floater方法进行浮动框定位; - 要想把浮动内容固定在右下角,脚本需要知道可用页面的宽度和高度,这时又得考虑不同浏览器上访问这些对象的方法也存在window.innerHeight和document.body.clientHeight的差异;
- 针对上下或左右滚动页面时浮动内容也需要随着页面移动,又需要考虑是用window.pageXOffset方法还是document.body.scrollLeft方法。。。
而使用JavaScript 框架就清净多了,比如jQuery就有专门的Floatbox库扩展,一句$.floatbox({content: “xxxx” );就能搞定,要是心情好还可以考虑是否加入渐变效果啥的,jQuery库在众多流行的 Web 浏览器版本上进行了可靠性测试,我们可以放心地使用这些框架,产生的JavaScript代码将会在不同浏览器和平台上以类似的方式工作。 More >