It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Partner Sites
Board index Programming JavaScript Forum

May I know what is the website javascript?

May I know what is the website javascript?

Postby newbie123 on Mon May 11, 2009 7:17 pm

http://www.computerproblemfix.com/

After I visit above website and wait after loading,
when I want to close it, then it popup a messagebox whether press OK or cancel.

I want the javascript sample as above website in the html.

If anyone can help me find the javascript and reply me, I would very appreciated. Thank you.
newbie123
 
Posts: 1
Joined: Mon May 11, 2009 7:11 pm

Re: May I know what is the website javascript?

Postby rangana on Thu May 14, 2009 7:14 am

Use the onbeforeunload event.

A basic example is:
Code: Select all
<script type="text/javascript">
window.onbeforeunload = function () {
   return "Are you really wanting to leave this page?";
}
</script>


See if it helps.
~ Get me some work, I do freelancing ~
User avatar
rangana
500+ Club
 
Posts: 929
Joined: Wed Feb 27, 2008 6:14 am
Location: Cebu City Philippines


Return to JavaScript Forum

Who is online

Users browsing this forum: No registered users and 8 guests