Why is Javascript called Javascript, if it has nothing to do with Java?

I need help with javascript?

  • //This code isnt displaying anything. its translated from java into javascript. //its supposed to take input from a prompt and then translate it into a code called rot13 //then display it on the webpage but its not even displaying the prompt <html> <body> <script type="text/javascript"> function isAlpha(str) { var re = /[^a-zA-Z]/g if (re.test(str)) return false; return true; } var keyLower = new Array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'); while(true) { var output = ''; var input = prompt("Enter text to be cyphered:); var i = 0; for(i = 0; i<input.length; i++) { if(!isAlpha(input.charAt(i))) //if not a letter { output += input.charAt(i); } else if(input.charAt(i).toLowerCase() == input.charAt(i)) //if a lower case character { for(var j = 0; j<26; j++) { if(input.charAt(i) == keyLower[j]) { output+=keyLower[(j+13)%26]; } } } else //if an Upper Case character { var k = 0; for(k = 0; k<26; k++) { if(input.charAt(i).toLowerCase() == (keyLower[k])) { output+=(keyLower[(k+13)%26]).to… } } } } document.write(output); } </script> </body> </html>

  • Answer:

    var input = prompt("Enter text to be cyphered:); Change it to var input = prompt("Enter text to be cyphered:"); Missing the end quote :P Works good too.

Domo Nazi at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.