I am just starting out on my JavaScript tutorial and it says to test this simple script out. However, I get the wrong output.
Does anyone know what the problem is? I should be getting an alert dialogue box. I have tried the following code on Chrome and Safari web browsers:
<!DOCTYPE HTML>
<HTML>
<HEAD>
<TITLE>Template</TITLE>
</HEAD>
<BODY>
<SCRIPT LANGUAGE = "Javascript">
alert("Hello World");
</SCRIPT>
</BODY>
</HTML>
And the browser output I am getting is:
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0
Arial;}} {*\generator Msftedit
5.41.15.1515;}\viewkind4\uc1\pard\f0\fs20 \par \par \tab \par \tab\tab \par \tab \par \tab\par \tab \par \tab\tab\par \tab \par \par \tab
\par \par }
Please does anyone know what the problem is? Thank you.
Sounds like you’re using an evil Windows product to write your code. Try using notepad instead. Long story short: you’re capturing hidden characters inserted by your editor.