Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1227 How can I encode a character string into its hexadecimal ASCII representation?

You are here: irt.org | FAQ | JavaScript | Text | Q1227 [ previous next ]

Try:

<script language="JavaScript"><!--
var text1 = 'a?bc4*';
var text2='';

for (i=0;i<text1.length;i++)
    text2 += text1.charCodeAt(i).toString(16);

alert(text2);
//--></script>

©2018 Martin Webb