Hello guys here is a simple code on how to password protect a webpage usingĀ javascript.This is not a good idea coz it is not at all secure.But simply just like that a webpage which is protected using simple javascript is fun.
<script type=“text/javascript”>
function passWord() {
var testV = 1;
var pass1 = prompt(‘Please Enter Your Password’,’ ‘);
while (testV < 3) {
if (!pass1)
history.go(-1);
if (pass1.toLowerCase() == “iamlost”) {
alert(‘You Got it Right!’);
window.open(‘theotherpage.html’);
break;
}
testV+=1;
var pass1 =
prompt(‘Access Denied – Password Incorrect, Please Try Again.’,'Give Me The Password’);
}
if (pass1.toLowerCase()!=”password” & testV ==3)
history.go(-1);
return ” “;
}
</SCRIPT>
<CENTER>
<FORM>
<input type=”button” value=”Enter Protected Area” onClick=”passWord()”>
</FORM>
</CENTER>
In the next version of this tutorial i can tell you guys how we can hide a div element and get the password from it do visit me often guys.
Incoming search terms:
- jquery password protect page (85)
- jquery password protected page (28)
- jquery password protect web page (14)
- jquery password protect a page (10)
- jquery password protection (8)
- jquery page protect (5)
- password protected page jquery (4)
- password protect jquery (4)
- jquery password protected area (3)
- jquery password protect script (3)
- password-protected page jquery (3)
- lock password page with jquery (3)
- password protect jquery gallery (2)
- password protect website html code (2)
- jquery password lock script (2)
- password protect page with jquery (2)
- javascript password protect single page (2)
- jquery page protection layer with password (2)
- jquery onclick password protect (2)
- password protect jquery page (2)
- password protect javascript (2)
- how to password protect a web page using java (2)
- wp password page (2)
- jquery password protect function (1)
- password protect web page jquery (1)
- password protect a page using jquery (1)
- password protect web page jquery script (1)
- password protect web pages with mysql (1)
- password protect ajax script (1)
- password protect a page using javascript (1)
- password lock wp homepage (1)
- password protect website javascript (1)
- password protect website jquery (1)
- password lock using jquery (1)
- password protect a web page html jquery (1)
- password protect using javascript secure (1)
- password protect page ajax (1)
- password protect html page with jquery (1)
- Password Protect Pages JavaScript (1)
- password protect html page with ajax (1)
