バイナリをテキストに翻訳してフォームに戻したいのですが、グーグルなどで例を見つけることができませんでした。
このようなものを作りたかった 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>