| |
<!DOCTYPE html> |
| |
<html> |
| |
<head> |
| |
<title>Protected Page</title> |
| |
<style> |
| |
body { |
| |
background-color: black; |
| |
display: flex; |
| |
justify-content: center; |
| |
align-items: center; |
| |
height: 100vh; |
| |
} |
| |
|
| |
input { |
| |
margin-bottom: 10px; |
| |
} |
| |
|
| |
#iframeContainer { |
| |
display: none; |
| |
width: 80%; |
| |
} |
| |
|
| |
#iframeContainer iframe { |
| |
width: 100%; |
| |
height: 80vh; |
| |
} |
| |
</style> |
| |
</head> |
| |
<body> |
| |
<div id="passwordForm"> |
| |
<input type="password" id="passwordInput" placeholder="Enter password" /> |
| |
<button type="button" onclick="checkPassword()">Submit</button> |
| |
</div> |
| |
|
| |
<div id="iframeContainer"> |
| |
///这里放iframe代码 |
| |
</div> |
| |
|
| |
<script> |
| |
function checkPassword() { |
| |
var password = document.getElementById("passwordInput").value; |
| |
if (password === "abc") { |
| |
document.getElementById("passwordForm").style.display = "none"; |
| |
document.getElementById("iframeContainer").style.display = "block"; |
| |
} |
| |
} |
| |
</script> |
| |
</body> |
| |
</html> |
| |
|