Jump to content

Pop-Up Box Question


djfox

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.