View Full Version : alerts!!!
sarah
01-14-2003, 02:55 PM
Hi ALL!!!
Does anyone know how to close / redirect a user to another page from an alert. I want to be able to click on ok and then go to another page.
Any ideas?
Thanx
Sarah
beetle
01-14-2003, 03:42 PM
You can do that with a confirm
if ( confirm( "Whatever message here" ) ) top.location.href = 'somepage.htm';
vkidv
01-14-2003, 04:04 PM
easy!
alert answer..
would you like to be displayed with an option of yes and no in an alert?
use:
<script>
function asktogo(web,txt)
{
askme=confirm(txt)
if(askme==true)
window.location.replace(web)
else
return false
}
</script>
then when you want the option to come up as a link, put this in your html document(where you want to link to be):
<a href="javascript:asktogo('*','***');">**</a>
*** This is where you put the question text, before your visitor is taken to there specified destination.
** Of course put the title for the link :D
* Put the website address here so your want your visitors to be asked first before being taken there.
Not all of this might be this right, i might have to edit it a few times. lol.
NOTICE: FOR SOME REASON WHENEVER I TYPE IN JAVASCRIPT OR SOMTIMES, IT COMES OUT AS java script please do not make your scripts go wrong from this, always change it with no space in the middle :D
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.