©ilj@flowsim.se JavaScript code samples 24 JavaScript confirm - displays a confirm dialog box with OK and cancel buttons >>> this example in Swedish ![]() here to show a JavaScript confirm ! ![]() ![]() ![]() <A HREF="javascript:iljconfirm()" >Click here to show a JavaScript confirm dialog box</A> Clicking the link calls the function iljconfirm() that displays the JavaScript confirm and then executes some other code if the user clicks the OK button. Put the function within SCRIPT tags in the HEAD portion of the document (see MINIMANUAL 1 basics). <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> <!-- function iljconfirm() { if(confirm("If you choose OK youŽll get to the page about lastModified.")) { window.location ='newpage.html' //1 } } //--> </SCRIPT> Put the text string (in italics here) on ONE line. 1 URL here, i e the same thing you would have put after A HREF had you not used a confirm window OTHER JAVASCRiPT EXAMPLES ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Page by ![]() ilj@flowsim.se Last modified: December 12, 1997 This page should be part of a frames system at: http://www.flowsim.se JAVASCRiPT |