How do I convert an array to a string (JavaScript)?
<html>
<head>
<script>
function xor_encryption()
{
var xor_it=document.getElementById('the_text_id').valu e;
var xor_it2=document.getElementById('comparison').valu e;
for(i=0;i<xor_it.length;i++)
{
//Stores the input inside an array
var store_xor_it=new Array();
store_xor_it=xor_it.substring(i,i+1);
var store_xor_it2=new Array();
store_xor_it2=xor_it2.substring(i,i+1);
var compare_results=new Array();
//Performs XOR operation, stores result in an array
compare_results=store_xor_it^store_xor_it2;
}
}
</script>
</head>
<body>
<form name="theForm">
Original Bytes
<br/>
<input type="text" name="the_text" id="the_text_id"/>
<br/>Comparion Bytes<br/>
<input type="text" id="comparison"/>
<input type="button" name="theButton" id="send_it" value="Submit" onClick="xor_encryption()"/>
<br/><br/>
<textarea id="gettext" rows="10" cols="20">
</textarea>
</form>
</body>
</html>
This is where I am stuck. I could easi
^store_xor_it2; --- the truncated line
I could easily put the array in an alert statement, but when you have a 50-digit string, it gets tediously long, so I wanted to join the array elements together and put them inside the textarea, but using compare_results.join(""); returns an error.
Any help is appreciated. Thanks!
Any help is appreciated. Thanks!
|