WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-08-2005, 05:57 AM
abalfazl abalfazl is offline
WebProWorld Member
 

Join Date: Mar 2005
Posts: 29
abalfazl RepRank 0
Default Why has this function used in that code?

Hello
Please check this link:
http://www.w3schools.com/js/tryit.as...ame=tryjs_time
Why has this function used in that code?
function stop()
Reply With Quote
  #2 (permalink)  
Old 03-11-2005, 12:37 PM
ADAM Web Design's Avatar
ADAM Web Design ADAM Web Design is offline
WebProWorld 1,000+ Club
 

Join Date: Dec 2003
Location: Toronto, Ontario, Canada
Posts: 2,217
ADAM Web Design RepRank 0
Default

In general terms, it's done to stop the timer.

You could use it as a form button if you were doing some sort of "stopwatch"-style application where someone had to clock the form button to pause the clock.

In this case, it's being used when the page is unloaded (either the browser is closed or the user is going somewhere else) to stop the time.
Reply With Quote
  #3 (permalink)  
Old 03-11-2005, 01:24 PM
PizdusInc PizdusInc is offline
WebProWorld Member
 

Join Date: Jul 2004
Location: Southern California
Posts: 59
PizdusInc RepRank 0
Default

I believe it is there to stop the javascript from running when the page is unloaded... It is being pulled up by onunload="stop()" in the body tag!
__________________
Doing what you like is freedom, liking what you do is happiness.

Some things cannot be heard or touched, but are felt within your heart.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: code, function, used



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Search Engine Friendly URLs by vBSEO 3.0.0