Hi, I'm very new to javascript, and I'm working on a simple script that will allow me to take a string of numbers, and convert it to a word. For example:
I type 00010203 into a box, and it would return abcd.
I've got the above to work, however..I'd like to add a couple special characters so that when the user types in a string that contains "32" it will return a ' ' (space). For example:
000102033200010203 would return 'abcd abcd'
Here's my code, as of now:
Code:
<script type="text/javascript">
function show_prompt()
{
var s = prompt("Please enter a string of numbers");
for (i = 0; i <=s.length; i = i+2)
{
var t = s.slice(i,i+2)
var n = parseInt(t,10) + 97
document.write (String.fromCharCode(n))
}
}
</script>