I'm pretty new to coding, and I'm trying to complete Codecademy's Javascript course. I've learned a little bit about HTML/CSS and I'm almost done with JavaScript. I've researched people having similar problems, but those solutions typically involve JQuery, which I haven't learned.
Here is my HTML (index.html):
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="main.js"></script>
</head>
<body>
</body>
</html>
Here is the beginning of my JavaScript:
alert();
// Acquire character's name and check to make sure it's a string
var charName = prompt("NASA Receptionist: 'Welcome to Mission Control.
May I have your last name, please?'");
var nameCheck = function(charName) {
while (typeof charName === "number") {
charName = prompt("NASA Receptionist: 'Surely, your name is not
a number... Please, may I have your last name?'");
}
};
nameCheck(charName);
NOTE: index.html is in the same folder as main.js
When I open the index.html, nothing happens, not even the opening alert(). Am I missing something?