After searching I've found how to make an onload alert box when the page loads. However what I want to do is
1. When user goes to page the alert box/pop loads w/o the page, just an alert box.
2. Once the user clicks on OK, the page loads.
After searching I've found how to make an onload alert box when the page loads. However what I want to do is
1. When user goes to page the alert box/pop loads w/o the page, just an alert box.
2. Once the user clicks on OK, the page loads.
For that you have to utilize JQuery:
http://docs.jquery.com/How_jQuery_Works
Follow the link and do the sample as says. Search for the string "Launching Code on Document Ready".
If you don't want to use jQuery you could set up your page to have an onClick event attached to the button that then would either reload the page with a param passed to the page that basically tells the page to load the rest of the content (could be a form submit with a hidden param). Or you could make an ajax call back to the main page that sends the rest of the content which you then could add to the page. There are lots of different ways to go about what you want to do and it really depends on your knowledge level and motivation. The simplest would be a form submit that reloads the page with a new param sent to the loading page telling it to load the rest of the content.
Thanks, I'll try to wrap my head around some of this. My level of knowledge is near 0, I'm not a coder I just hack together what I can for my pages=)
<body><button id='pause' value='continue' onclick='document.getElementById("pause").style.display="none";document.getelementById("content").style.display="block";'>
<div id='content' style='display:none;'> rest of page </div></body></html>
??
On second thought the post by almostbob is probably the simplest and quickest to do. You render both the alert and the rest of the page. You have a div wrapped around the rest of the content with an ID and either a class that has a css style for display:none on it or just inline css as shown in almostbob's example. Then when the user affirms the alert box you grab the div wrapping the rest of your content and set the style to display: "" (again see almostbob's example above) or dispaly:block (either should work). The only downside is that anyone who views source/firebug/ or other developer tool will be able to see the content so if it is content that you don't want them to see at all you probably should try the form submit stuff.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.