0

我试过这个:

http://jsfiddle.net/CG8gx/1/

for(var i = 0x00; i <= 0x88; i++){
    i = i.toString();
    if (i.length === 1) { 
        i = "0" + i;
    }
    // console.log(i.length);
    console.log(i);
    // console.log(decodeURIComponent("%" + i));
}

toString()会给出十进制表示。所以上面的代码被破坏了。

4

1 回答 1

3

you can try this

for(var i = 0x00; i <= 0x88; i++){
    i = "0x" + i.toString(16);

    console.log(i);

}

will show

0x0
0x1
0x2
...
于 2013-08-18T19:28:29.303 回答