Is there a script for confirng site exist with an alert?
I want something that says yes or cancel (or similar) in a alert message before leaving the site. but usually using "confirm" and pressing cancel button does the same as the yes button (leaves the site).
<HTML>
<HEAD>
<SCRIPT>
function closeIt()
{
event.returnValue = "Any string value here forces a dialog box to \
appear before closing the window.";
}
</SCRIPT>
</HEAD>
<BODY onbeforeunload="closeIt()">
<a href="">Click here to navigate to</a>
</BODY>
</HTML>
this actually works out, but I don't want the extra text. is there a way to get this effect without the extra text? just my text, and confirm box working?



Reply With Quote

indeed that is the type of alert box... just want that for exiting the page... the box could also have configurable text... and when ok is pressed, one leaves... when cancel is pressed, one stays (also an alert message could appear as an option).
Bookmarks