Home
Home

Directory
Directory

Articles
Internet News
Security News
Ecommerce News
Domain News

Site Tools
Site Speed Test
Keyword Research
Resolve Hostname
DNS Tools
Register Domains
Affiliate Programs
Open Source

Shopping Carts
Cart Reviews
SSL Certificates

Enter your email address to subscribe to our updates:

Delivered by FeedBurner


Venue Charts
Channel Traffic Rankings
OAI Stock Quotes and Charts
eBay's Worst Feedback

Forum
Forum Home
TulipTools News
Advertising
Blogging
Computer Hardware
Domain Names
Ecommerce
Financing
Int'l Trading
Graphics and HTML
Internet Access
Legal Issues
Internet Business
Auction Sites
Classified Ad Sites
Fixed Price Venues
Operating Systems
Programming
Search Engines
Internet Security
Software
Web Hosting
Webmaster Issues
Reviews
Announcements
Off Topic Discussion

Web Hosting
TulipHosting

Domain Names
TulipDomains

Web Stats
TulipStats

Forum Rules
Forum Rules
Privacy Policy

Site Map
Forum Sitemap
Sitemap Topics




Directory| Forums| Internet News|Cart Reviews| DNS Tools| Keyword Research| Site Speed Test| Security| | Domain Marketplace| Domain Blog
TulipTools Internet Business Owners and Online Sellers Community
  • Home
  • Search
  • Member List
  • Calendar
Hello There, Guest! Login Register
TulipTools Internet Business Owners and Online Sellers Community › Graphics, Ajax, HTML, Multimedia, Web Design › Graphics, Ajax, HTML, Multimedia, Web Design › HTML, CSS, DHTML, Javascript, AJAX, and Coding › Javascript
Need Help With Javascript

  
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
Need Help With Javascript
01-27-2008, 03:37 PM,
Post: #1
BellisimaJ. Offline
Rabble-Rouser
*********
Posts: 6,609
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2006
Reputation: 0
Need Help With Javascript
I'm trying to teach myself javascript, and I don't understand how some of it works. For example, the code snippet below is from w3schools. It is a simple numerical clock/timer.
This may seem to be a stupid question (I feel stupid asking it  Tard), but how does the script know where to acquire the correct time? :-[ Tard Iamwithstupid

Code:
<html>
<head>
<script type="text/javascript">
function startTime()
{
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
// add a zero in front of numbers<10
m=checkTime(m);
s=checkTime(s);
document.getElementById('txt').innerHTML=h+":"+m+":"+s;
t=setTimeout('startTime()',500);
}

function checkTime(i)
{
if (i<10)
  {
  i="0" + i;
  }
return i;
}
</script>
</head>

<body onload="startTime()">
<div id="txt"></div>
</body>
</html>
Like Post Reply
[+]
01-27-2008, 06:16 PM,
Post: #2
regic Offline
Administrator
*******
Posts: 2,825
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Jul 2005
Reputation: 0
Re: Need Help With Javascript
It reads your computer's mind.
Like Post Reply
[+]
01-27-2008, 07:36 PM,
Post: #3
BellisimaJ. Offline
Rabble-Rouser
*********
Posts: 6,609
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2006
Reputation: 0
Re: Need Help With Javascript
I knew it was a stupid question.  Tard  Thanks, reg. :-[

Is that what the variable is telling it to do----------get the time from the pc viewing the page? Icon_scratch

Code:
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
Like Post Reply
[+]
« Next Oldest | Next Newest »




Possibly Related Threads…
Thread Author Replies Views Last Post
  Adding A JavaScript Image Flip mandy 1 2,165 12-14-2008, 09:18 PM
Last Post: BellisimaJ.
  SEO Tips for JavaScript Lightbox Content mandy 0 2,975 11-20-2008, 12:46 PM
Last Post: mandy
  75 Useful Javascript Techniques mandy 0 1,892 09-14-2008, 07:52 AM
Last Post: mandy
  Exploring JavaScript's language features mandy 0 2,378 12-20-2006, 12:00 PM
Last Post: mandy
  Javascript security problems are an increasing risk for sites, users regic 0 2,334 07-30-2006, 01:28 PM
Last Post: regic
  Taking HTML Further With Javascript mandy 0 2,421 01-24-2006, 09:16 AM
Last Post: mandy
  Javascript Tutorial and Reference Resources regic 3 3,480 01-10-2006, 04:58 AM
Last Post: misteroriginal

  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)
  • Contact Us
  • TulipTools Internet Business Owners and Online Sellers Community
  • Return to Top
  • Lite (Archive) Mode
  • RSS Syndication
  • Help
Current time: 07-01-2022, 05:53 AM Powered By MyBB, © 2002-2022 MyBB Group. Theme created by Justin S.
powered by Apache

powered by Linuxpowered by CentOS

Copyright 2000-2013 TulipTools.com. All rights reserved.