View Full Version : popup with background disabled

07-15-2009, 03:36 PM
I need a script to generate a popup when page loads with background disabled. Please help

07-15-2009, 03:39 PM
What you mean by "background disabled"?

07-16-2009, 08:27 AM
basically I need a script for LightBox.
I googled for the same and got a few scripts but I can only dispaly images with those scripts; not html or any dynamic page content

My requirement is that
when a page loads say page.html, i want to show a popup message which is being displayed from another html page say popup.html or from a hidden div tag on page.html, but the contents of page.html should not be accessible unless a user confirms certain details on given on popup window

Philip M
07-16-2009, 09:04 AM
Most modern browsers block pop-ups.

Try something like this:-

<div id = "div1" style="visibility:hidden">
Content of this div

<div id = "div2" style="display:block">
Enter the correct details here to continue <input type = "text" id = "details" onblur = "showPage()";

<div id = "div3" style="visibility:hidden">
Content of this div

<script type = "text/javascript">

function showPage() {
if (document.getElementById("details").value = "correct details") {
document.getElementById("div1").style.visibility = "visible";
document.getElementById("div3").style.visibility = "visible";
document.getElementById("div2").style.display = "none";


Remember that users with Javascript disabled will not be able to see the page. And of course the "correct details" (in effect the password) will be easily visible with "View Source". You can marginally conceal this by placing your script in an external .js file. But I expect you realise that anything beyond very weak security requires server-side scipting.

"There is hardly anything in the world that some man cannot make a little worse and sell a little cheaper, and the people who consider price only are this man's lawful prey." John Ruskin