ajax+xhtml+css开发

Native XMLHttpRequest Support in IE 7.0 is NOT Ready

由 joelhy 于 周五, 07/13/2007 - 11:05 提交。
From jQuery 1.1.3.1 code Line4427-4429:
  1. // Create the request object; Microsoft failed to properly
  2. // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
  3. var xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();

jQuery tells us "new XMLHttpRequest()" has some problems in IE7, so think ActiveXObject first, native XMLHttpRequest second.

A Clock in Canvas

由 joelhy 于 周一, 07/09/2007 - 21:35 提交。
// Wait for the browser to load window.onload = function() { // Draw the clock clock(); // and re-draw the clock every second thereafter setInterval(clock, 1000); }; function clock() { // Get the current date and time var now = new Date(); var sec = now.getSeconds(); var min = now.getMinutes(); var hr = now.getHours(); hr = hr >= 12 ? hr - 12 : hr; // Get the drawing context of the element var ctx = document.getElementById('canvas').getContext('2d'); ctx.save();

jQuery新版发布,性能提升重大

由 joelhy 于 周三, 07/04/2007 - 19:37 提交。

7月1日jQuery 1.1.3发布,据jQuery官方博客介绍,相比1.1.2版本有了很大的性能提升,主要的改进有:

唯有等待IE8

由 joelhy 于 周一, 06/04/2007 - 22:29 提交。
  1. IE6实在让人抓狂,开发过程中所谓的hack、bug几乎都是针对IE的。
  2. IE7同样不能令人满意-对现有bug的修复、CSS2的支持等等都有很多欠缺的地方。
  3. 同样,目前来说希望firefox或opera等浏览器来取代IE的地位也是不现实的。 唯一能做的就是发发牢骚,期望明年的IE8不要再让人失望!

在jQuery里替换DOM节点

由 joelhy 于 周一, 06/04/2007 - 21:35 提交。

由于jQuery没有提供一个用来替换指定节点(node)的api,这就需要组合已提供的api来实现该功能。普遍的做法是组合使用remove()和after()或before()。
例子如下:

  1. remove() + after()
    $("#node_to_remove").after(node_to_insert_content).remove();
  2. remove() + before()
    $("#node_to_remove").before(node_to_insert_content).remove();

Ajax开发书籍推荐

由 joelhy 于 周日, 06/03/2007 - 14:32 提交。
Ajax in Action 公认的Ajax开发权威著作,个人觉得其最大的作用是转变web开发的思想。
Professional Ajax, 2nd Edition 学习Ajax开发的几种核心技术的不错书籍