Skip to content

Latest jQuery v1.3.2’s bug on WebKit

26 February 2009

I found a bug (may be a browser bug) which is happen on my favorite framework, the latest version of jQuery (v1.3.2) on WebKit browser when I was trying slickspeed with some popular JavaScript Frameworks.

Here the screenshots:

Safari 3.1.2
slickspeed-safari

Chrome 1.0.154.48
slickspeed-chrome 

No problem found in Safari 3.1.2 Nightly, Firefox 3.0.6, Opera 9.63 and IE7.

Test the slickspeed here: http://xing.web.id/slickspeed/

Selectors I used:

  • p:nth-child(even)
  • p:nth-child(n)[class] > a
  • p:nth-child(even)
  • p:nth-child(n)[class] > a
  • p:nth-child(even)
  • p:nth-child(n)[class] > a
  • p:nth-child(even)
  • p:nth-child(n)[class] > a
  • p:nth-child(even)
  • p:nth-child(n)[class] > a

JavaScript Frameworks I used:

Chinese New Year 2009

10 February 2009

Day 1

Day 2


Day 3

View album

PHP.JS – Use PHP functions in JavaScript

03 February 2009

PHP.JS is an open source project in which to port PHP functions to JavaScript. The library is developed by Kevin van Zonneveld and his contributors, and they have been working hard in adding more functions into it. By including this library into your own web projects, you can use those higher-level PHP functions such as file_get_contents(), mktime(), serialize(), etc which JavaScript doesn't support them natively.

Here is a piece of sample code of PHP's encryption function: base64_encode():

function base64_encode( data ) {
 
    var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
    var o1, o2, o3, h1, h2, h3, h4, bits, i = ac = 0, enc="", tmp_arr = [];
    data = utf8_encode(data);
 
    do {
        o1 = data.charCodeAt(i++);
        o2 = data.charCodeAt(i++);
        o3 = data.charCodeAt(i++);
 
        bits = o1<<16 | o2<<8 | o3;
 
        h1 = bits>>18 & 0x3f;
        h2 = bits>>12 & 0x3f;
        h3 = bits>>6 & 0x3f;
        h4 = bits & 0x3f;
 
        tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
    } while (i < data.length);
 
    enc = tmp_arr.join('');
 
    switch( data.length % 3 ){
    case 1:
        enc = enc.slice(0, -2) + '==';
    break;
    case 2:
        enc = enc.slice(0, -1) + '=';
    break;
    }
 
    return enc;
}

The library is available in 2 different packages:

Happy Chinese Niu Year!

26 January 2009

Wish you have a prosperous moo year.
新年新气象,牛年行大运,恭喜恭喜。

Dealing with IE in Cross-Browser Test

24 January 2009

The following websites, Firefox add-ons and applications could be helpful for those web developers who are intended to test IE in cross-browser capability:

  • IE NetRenderer (Website, Firefox add-on)
    This tools just simply show up a screenshot of your website from the submitted URL with selected IE version. This tool also available in Mozilla Firefox Add-ons, here is the link https://addons.mozilla.org/en-US/firefox/addon/6455
  • IE Tab (Firefox add-on)
    This add-on can renders Microsoft Windows current IE engine on Mozilla Firefox's tab. By using this add-on, the necessary of opening the IE browser can be eliminated.
  • Browsershots (Website)
    A free open-source online service which makes screenshots of your website in different web browsers, in different operating systems. It has several options that can be set before making the screenshot, such as choosing screen size, color depth, Javascript enabling, Java and Flash which these features could be a strong point from the other similar service.
    The disadvantage of this service is it can't generate the screenshot on-the-fly. Because the screenshot is made by a number of distributed computers who are volunteered their computers automatically takes the screenshots from their web browser and upload them to the server. The whole process could take some times
  • MultipleIE (Application)
    A very handy tool which could run almost all IE family from version 3 through 6. Unfortunately, MultipleIE doesn't support on Windows Vista.
  • Microsoft Virtual PC 2007 (Application)
    A light-weight virtualization suite for Microsoft Windows operating systems, and it's faster than VMWare as I experienced before. If you are a Windows Vista user, using Virtual PC with the Windows XP + MultipleIE (or pre-installed IE6) can overcome the limitation of your IE testing capability. Unfortunately, Microsoft Virtual PC 2007 requires an OS with separated license key (even it works for pirated Windows, but it's illegal).
  • IETester (Application)
    IETester is a free web browser that allows you to have the rendering and javascript engines of IE8 beta 2, IE7, IE6 and IE5.5 on Microsoft Vista and XP, as well as the installed IE in the same process. This tool might not stable yet, since it's still an alpha release.

 

PS. The information above may out of date (in future), please visit their website for updated information.