求一个Javascript实现的任意进制转换程序 用JS有内置方法http://topic.csdn.net/t/20061230/01/5265658.html 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 揭帖这么快!汗!写了个小demo<table> <tbody> <tr> <th>2进制</th> <input type="text" id="txtNum"/> <td><input type="button" value="10转2" onclick="convert_digits_from('txtNum',2)"/></td> </tr> <tr> <th>3进制</th> <td><input type="button" value="10转3" onclick="convert_digits_from('txtNum',3)"/></td> </tr> <tr> <th>4进制</th> <td><input type="button" value="10转4" onclick="convert_digits_from('txtNum',4)"/></td> </tr> <tr> <th>5进制</th> <td><input type="button" value="10转5" onclick="convert_digits_from('txtNum',5)"/></td> </tr> </tbody></table><script> var w=function(s){alert(s)}; var convert_digits_from=function(num,el) { var obj=document.getElementById(num).value; //alert(obj);alert(el); //alert(obj.toString(el)); w(parseInt(obj,10).toString(el)); };</script> 网页快照,怎么实现? 脚本求优化 javascript调用Flash中的函数 一个很奇怪的关于offsetParent的问题,可能个CSS有关,狂晕中。 可不可以讲解一下这段代码?? IE地址栏中的地址如何隐藏?请大家指教 大神佑我啊 正则给所有的src的值上加上“http://127.0.0.1” js与vbs变量传递问题~~~~ 在线等 在客户现场急问: 请大家指教 JS数据传入方式类似,却造成图形有的无图,有的显示,求大家帮助! |zyciis| 为什么我用Packer加密后程序不能用啊,谢谢
<tbody>
<tr>
<th>2进制</th>
<input type="text" id="txtNum"/>
<td><input type="button" value="10转2" onclick="convert_digits_from('txtNum',2)"/></td>
</tr>
<tr>
<th>3进制</th>
<td><input type="button" value="10转3" onclick="convert_digits_from('txtNum',3)"/></td>
</tr>
<tr>
<th>4进制</th>
<td><input type="button" value="10转4" onclick="convert_digits_from('txtNum',4)"/></td>
</tr>
<tr>
<th>5进制</th>
<td><input type="button" value="10转5" onclick="convert_digits_from('txtNum',5)"/></td>
</tr>
</tbody>
</table>
<script>
var w=function(s){alert(s)};
var convert_digits_from=function(num,el)
{
var obj=document.getElementById(num).value;
//alert(obj);alert(el);
//alert(obj.toString(el));
w(parseInt(obj,10).toString(el));
};
</script>