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
https://forums.phpfreaks.com/topic/140884-pop-up-box-question/
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
https://forums.phpfreaks.com/topic/140884-pop-up-box-question/#findComment-737530
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.