djfox Posted January 15, 2009 Share Posted January 15, 2009 I would like a pop-up box to appear before the page is loaded and have two buttons on it. If the user clicks "yes", the page will load like normal. If they click "no", they should be redirected to the page they were on previously. How would I accomplish this? Or even if someone knows what this kind of code is called and could tell me, I could probably do some searching for it. Quote Link to comment Share on other sites More sharing options...
dclamp Posted January 15, 2009 Share Posted January 15, 2009 Popups are normally disabled. An alternative would be to have the Yes No question on your first page, and redirect to the other pages. Quote Link to comment Share on other sites More sharing options...
emehrkay Posted January 15, 2009 Share Posted January 15, 2009 I dont know if this will stop the page from loading, but you want to use the confirm() function in the head script tag and it should fire as soon as it is parsed. I just dont know if the rest of the html will render while the popup confirmation window is active var ans = confirm('Question ?'); if(!ans) history.back(); //look up the history object I dont use it much Quote Link to comment Share on other sites More sharing options...
djfox Posted January 15, 2009 Author Share Posted January 15, 2009 I guess pop-up is the wrong term. x.x Alert box? Quote Link to comment Share on other sites More sharing options...
rascle Posted January 16, 2009 Share Posted January 16, 2009 Yes that should work and it is a called a Prompt Box Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.