Hi all,
I am a beginner learning JavaScript.
I have typed my entire program in notepad the following is the coding :
html>
<head>
<title> JavaSCript Addition Of 2 Numbers
</title>
</head>
<body>
<script type="text/javascript">
var x,y,z;
x=5;
y=10;
z=x+y;
document.write("The Addition of 2 numbers is : ");
document.write(z);
</script>
</body>
</html>
Now with what extension should I save the above file?
If I save the above file with .js extension I am getting a dialog box stating that the error : File is undefined.
But when the above file is saved with the .html extension it is working very well.
So can anybody tell me whether saving it withthe extension .html is correct or not?
If it is wrong then what should I do to execute my JavaScript files using the .js extension?
Please help me.
Thanks in advance!!


Reply With Quote
Bookmarks