JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 6th, 2011, 11:57 AM
kjlkgreen kjlkgreen is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2011
Posts: 2 kjlkgreen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 21 sec
Reputation Power: 0
Exclamation Other - Need help with Javascript Programming

This is what i have so far:<title>SkyWeb: The Planisphere</title>
<link href="skyweb.css" rel="stylesheet" type="text/css" />

<sript type="text/javascript" src="datetime.js"></script>

<script type="text/javascript">

/*
timeStr is a text string containing the current date and time
mapNum is the number of the map to display in the planisphere
*/

var timeStr = showDateTime();
var mapNum = getMap();
</script>



</head>

<body>
<div id="pageContent">

<div id="logo">
<img src="skyweb.jpg" alt="SkyWeb" />
</div>

<div id="maps">
<script type="text/javascript">
document.write("<img id=\"sky\" src='sky"+mapNum+".jpg' alt='' />");
</script>

<img id="mask" src="mask.gif" alt="" />
<div id="datetime">
<script type="text/javascript">
document.write(timeStr);
</script>

</div>
</div>

This is the external js file:
function showDateTime() {
var thisDate = new Date();
var thisWDay=thisDate.getDay();
var thisDay=thisDate.getDate();
var thisMonth=thisDate.getMonth();
var thisYear=thisDate.getFullYear();
var mName = new Array("January", "February", "March", "April", "May",
"June", "July", "August", "September", "October","November", "December");
var hours=thisDate.getHours();
var minutes=thisDate.getMinutes();
ampm = hours >=12 ? " pm" : " am";
hours = hours > 12 ? hours-12 : hours;
minutes = minutes < 10 ? "0"+minutes : minutes;
return mName[thisMonth]+" "+thisDay+", "+thisYear + ", " + hours + ":" + minutes + ampm;
}

Here are the instructions, I have an error somewhere but cannot find it.. any assistance would be greatly appreciated.
So this is what I'm supposed to do:
1. declare a variable named timeStr equal to the value returned from the showDateTime() function.
2. declare a variable named mapNum equal to the value returned from the getMap() function.

3. In the below HTML code, replace the line " <img id='sky' src="sky0.jpg" alt="" /> " with a script element that writes the HTML code: <img id='sky' src='skymapNum.jpg' alt=' ' /> (mapNum is the value of the mapNum variable)

4. In the below HTML code, replace the date/time value "january 1, 2007, 12:00 am" with a script element that writes the value of the timeStr variable to the web page.

Reply With Quote
  #2  
Old March 6th, 2011, 12:00 PM
kjlkgreen kjlkgreen is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2011
Posts: 2 kjlkgreen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 21 sec
Reputation Power: 0
OMG!!!
As soon as I posted, I saw one of the errors.. I have sript instead of script... LOL!! Does anyone see anymore?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Other - Need help with Javascript Programming


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap