我想将二进制翻译成文本并以表格形式返回,我在谷歌或其他东西上找不到任何示例。
我想做这样的东西 http://www.roubaixinteractive.com/PlayGround/Binary_Conversion/Binary_To_Text.asp
我在搜索时找到了这段代码,但我无法让它工作:#
<script type="text/javascript">
//<![CDATA[
function txt2bin()
{
url = 'http://services.webestools.com/txt2bin/txt2bin.js?str='+encodeURIComponent($('ftxt').value);
var js_effets=document.createElement("script");
js_effets.setAttribute("type", "text/javascript");
js_effets.setAttribute("src", url);
document.getElementsByTagName("script")[0].parentNode.insertBefore(js_effets,document.getElementsByTagName("script")[0]);
$('frm').style.display='block';
}
function bin2txt()
{
url = 'http://services.webestools.com/txt2bin/bin2txt.js?str='+encodeURIComponent($('fbin').value);
var js_effets=document.createElement("script");
js_effets.setAttribute("type", "text/javascript");
js_effets.setAttribute("src", url);
document.getElementsByTagName("script")[0].parentNode.insertBefore(js_effets,document.getElementsByTagName("script")[0]);
$('frm').style.display='block';
}
//]]>
</script>