06-28-2010, 09:21 AM
Code:
<html>
<head><title>IT430 :: Assignment 4</title>
</head>
<body>
<script language="javascript" type="text/javascript">
var str1= "Hello";
var key =15;
var vcode ="";
document.write("Now Scrambling Hello to meaningless "+"<BR>");
for (i=0;i<str1.length;i++)
{
vcode = (parseInt(str1.charCodeAt(i)+key));
document.write(String.fromCharCode(vcode));
}
</script>
</body>
</html>