Computer Science Canada Javascript alert customization |
Author: | HaVoC [ Fri Nov 14, 2003 7:15 pm ] |
Post subject: | Javascript alert customization |
How would I make a javascript alert, that when you press OK it goes to a page, but there's no Cancel button...? |
Author: | Thuged_Out_G [ Thu Nov 20, 2003 6:43 pm ] |
Post subject: | |
couldnt you use a prompt for that? |
Author: | Tendulkar [ Tue Nov 25, 2003 10:38 pm ] |
Post subject: | Re: Javascript alert customization |
HaVoC wrote: How would I make a javascript alert, that when you press OK it goes to a page, but there's no Cancel button...?
% HERE IS YOUR CODE: I'm not sure for your answer but i hope this may satisfy you. <body> <SCRIPT language="JavaScript"> <!-- function go_there() { var where_to= confirm("Do you really want to go to this page??"); if (where_to== true) { window.location="http://www.compsci.ca/"; } else { window.location="http://www.compsci.ca/mx"; } } //--> </SCRIPT> <A HREF="javascript:go_there()">New Page</A> </body> |
Author: | Tendulkar [ Tue Nov 25, 2003 10:39 pm ] |
Post subject: | Re: Javascript alert customization |
HaVoC wrote: How would I make a javascript alert, that when you press OK it goes to a page, but there's no Cancel button...?
% HERE IS YOUR CODE: I'm not sure for your answer but i hope this may satisfy you. <body> <SCRIPT language="JavaScript"> <!-- function go_there() { var where_to= confirm("Do you really want to go to this page??"); if (where_to== true) { window.location="http://www.compsci.ca/"; } else { window.location="http://www.compsci.ca/mx"; } } //--> </SCRIPT> <!--Put a link here --><A HREF="javascript:go_there()">New Page</A> </body> |