$(document).ready(function() {
$(document).display(none);
var password =("You have just entered a private website. Please enter the password to access it!");
if (password == "biology") {
$(document).display();
}
else {
window.location.replace("https://www.google.co.uk")
};
});
html {
background-image: url("bg.jpg")
}
body {
margin: 0 25%;
background-color: #ccc;
}
nav li {
padding-left: 5px;
border: solid 5px #aaa;
}
nav ul {
list-style-type: none;
position: fixed;
left: 9%;
font-size: 36px;
}
nav a {
color: #ccc;
text-decoration: none;
}
article {
background-color: white;
border: white solid #c0c;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!DOCTYPE html>
<html lang="pl">
<head>
<title>Krystian Mikołajczyk</title>
<link href="style.css" rel="stylesheet" type="text/css">
<link href="jquery-2.1.1.js" type="text/javascript">
<link href="pass.js" type="text/javascript">
</head>
<body>
<header>
<h1 align="center"><i>Krystian Mikołajczyk</i></h1>
</header>
<nav>
<ul><i>
<li><a href="#">Home</a></li>
<li><a href="#">Uploads</a></li>
<li><a href="#">Downloads</a></li>
<li><a href="#">Contact</a></li>
</i></ul>
</nav>
<br>
<br>
<br>
<article>
<section>
<h1>Recent Update</h1>
</section>
</article>
</body>
</html>
I was trying to make a website for myself that I can use anywhere any time and I wanted to protect it with a password, especially if I was going to have some downloads and uploads that I wanted to keep for myself.
The password is suppose to be "biology" because I would like my biology teacher to upload a pdf book for me during the development.
I don't know what I did wrong but the prompt message didn't want to come up and that's what I'm wondering about.