如果需要把其他进制转换成十进制 parseInt(str,2); parseInt(str,8); parseInt(str,16); 要把其他进制转换成二进制 var s = num.toString(2); 其他的以此类推