惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

小众软件
小众软件
博客园 - Franky
罗磊的独立博客
G
Google Developers Blog
The GitHub Blog
The GitHub Blog
P
Proofpoint News Feed
Recent Announcements
Recent Announcements
V
V2EX
F
Fortinet All Blogs
阮一峰的网络日志
阮一峰的网络日志
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
U
Unit 42
GbyAI
GbyAI
A
About on SuperTechFans
WordPress大学
WordPress大学
Engineering at Meta
Engineering at Meta
雷峰网
雷峰网
Microsoft Azure Blog
Microsoft Azure Blog
Martin Fowler
Martin Fowler
D
DataBreaches.Net
The Cloudflare Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
MongoDB | Blog
MongoDB | Blog

博客园 - taodesign

一个自定义分享按钮 解决windows下nginx中文文件名乱码 sublime text 3 添加 javascript 代码片段 ( snippet ) transition动画最简使用方式 hammerjs jquery的选项使用方法,以给swipe设置threshold和velocity为例 sublime text 3 的emmet 添加自定义 html 片段 解决 placeholder 垂直不居中,偏上的问题 Sublime Text 3 配置 sass 解决phpwind 9 转换到 discuz x 3.1的头像仍然不显示问题 sina微博登录框和twitter的比较 PHP初学者必看 不用qq的这一个月 虽然qq的第二封信些的相当中肯,但是—— 从现在起,试着不用qq一个月,看看什么情况 百度兵陷日本,Google 90% Baidu 1% wordpress 侧栏微博插件 Miniposts blogger导入到blogbus非常顺利 ie8 的断字/断行 bug dede vs 帝国
javascript 进制转换(2进制、8进制、10进制、16进制之间的转换)
taodesign · 2014-03-11 · via 博客园 - taodesign

//十进制转其他  
var x=110;  
alert(x);  
alert(x.toString(8));  
alert(x.toString(32));  
alert(x.toString(16));  
//其他转十进制  
var x='110';  
alert(parseInt(x,2));  
alert(parseInt(x,8));  
alert(parseInt(x,16));  
//其他转其他  
//
先用parseInt转成十进制再用toString转到目标进制  
alert(String.fromCharCode(parseInt(141,8)))  
alert(parseInt('ff',16).toString(2));

posted @ 2014-03-11 14:18  taodesign  阅读(220)  评论(0)    收藏  举报