I would appreciate very much if someone could help me figure out what I am doing wrong. I have checked the code over and over and still can't figure out why it won't write to the web page. Perhaps an outside eye could help. Here goes...not sure which tags to use for .js so forgive me if I just cut/paste.
Here's my js file: - function XmasDays(thisDate) {
-
var XMYear=thisDate.getFullYear();
-
var XMDay=new Date("December, 25, 2005");
-
XMDay.setFullYear(XMYear);
-
var dayTotal=(XMDay-thisDate)/(1000*60*60*24);
-
dayTotal=Math.round(dayTotal);
-
return dayTotal;
-
}
-
-
function showDate(thisDate){
-
var thisWDay=thisDate.getDay();
-
var thisDay=thisDate.getDate();
-
var thisMonth=thisDate.getMonth();
-
var thisYear=thisDate.getFullYear();
-
var monthName=new Array(12);
-
monthName[0]="January";
-
monthName[1]="February";
-
monthName[2]="March";
-
monthName[3]="April";
-
monthName[4]="May";
-
monthName[5]="June";
-
monthName[6]="July";
-
monthName[7]="August";
-
monthName[8]="September";
-
monthName[9]="October";
-
monthName[10]="November";
-
monthName[11]="December";
-
var wdayName=new Array(7);
-
wdayName[0]="Sunday";
-
wdayName[1]="Monday";
-
wdayName[2]="Tuesday";
-
wdayName[3]="Wednesday";
-
wdayName[4]="Thursday";
-
wdayName[5]="Friday";
-
wdayName[6]="Saturday";
-
-
dateString="weekday, month day, year";
-
return (wdayName[thisWDay]+","monthName[thisMonth]+","+thisYear);
-
}
-
-
-
Here's the embedded scripts:
-
<td id="daycell">
-
<script type="text/javascript">
-
<!--Hide from non-JavaScript Browsers
-
-
var today = new Date("Mon, Dec 24, 2008");
-
var niceDate = showDate(today);
-
var daysLeft = XmasDays(today);
-
document.write(niceDate+"< /br>");
-
-
if (daysLeft > 1) {
-
document.write("Only "+ daysLeft+"days until Christmas");
-
}else if( daysLeft==1){
-
document.write("Last day for Christmas Shopping")
-
}else{
-
document.write("Happy Holidays from North Pole Novelties");
-
}
-
-
//Stop hiding-->
-
</script>
here's my link:
[HTML]<title>North Pole Novelties</title>
<link href="styles2.c ss" rel="stylesheet " type="text/css" />
<script src="library2.j s" type="text/javascript"></script>
</head>[/HTML]
6 1677 acoder 16,027
Recognized Expert Moderator MVP
Is the embedded script in the body?
Yes, it's in my first cell.
Any help is appreciated. Thanks
Hi ,
ur code is perfectly right but the wrong is in the showDate(thisda te) function
the wrong is simple syntax error ie
return (wdayName[thisWDay]+"," + monthName[thisMonth]+","+thisYea r);
Place the bold one its enough
I would appreciate very much if someone could help me figure out what I am doing wrong. I have checked the code over and over and still can't figure out why it won't write to the web page. Perhaps an outside eye could help. Here goes...not sure which tags to use for .js so forgive me if I just cut/paste.
Hi ,
ur code is perfectly right but the wrong is in the showDate(thisda te) function
the wrong is simple syntax error ie
return (wdayName[thisWDay]+"," + monthName[thisMonth]+","+thisYea r);
Place the bold one its enough
Any help is appreciated. Thanks
OMG!!!! Thank you soooo much! You have no idea how much this has been driving me crazy! I figured it was something very simple. Amazingly my instructor couldn't pick that up either :) You are the man!.....or woman!
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Johno |
last post by:
I have written the two associated base classes below (Digital_camera and
Review) to manage digital camera and review objects. They are base classes
for which other derived classes can be written to provide more detail.
You'll notice that I've also declared the display functions as "virtual" to
allow for polymorphism. I now need to write a function to display all the
contents of an STL "deque" of pointers to Digital_camera objects. It needs...
|
by: Abhas |
last post by:
> > Hi, this is Abhas,
> > I had made a video library program in C++, but was facing a problem.
> > After entering 12 movies, i cannot enter any more movies.
> > Something gibberish comes instead.
> > Can somebody please tell whats wrong??
> > This is the code : :
#include<fstream.h>
#include<conio.h>
|
by: D |
last post by:
Hello all...I have an issue with one of my java script functions that
I'm hoping someone can easily help with. I have a web based application
that we use to create/sign up for overtime. When we have holidays we
require our employees to sign up in 4 hr increments for the times we
post. I'm having trouble creating a time slot that ends @ 12am. 12pm
and all other hours work fine for start/end times. however 12am causes
problems. My actual...
|
by: Rex |
last post by:
Hi All - I have a question that I think MIGHT be of interest to a
number of us developers. I am somewhat new to VIsual Studio 2005 but
not new to VB. I am looking for ideas about quick and efficient
navigating within Visual Studio 2005. Let's say your project (or
solution) has dozens of forms and hundreds or even thousands of
routines.
Two Questions:
1) BUILT-IN to Visual Studio 2005. What ideas do you have to quickly
|
by: gnawz |
last post by:
I have a pagination function I am using in a file called functions.php as below<? //Pagination functions function getPagingQuery($sql, $itemPerPage = 10) { if (isset($_GET) && (int)$_GET > 0) { $page = (int)$_GET; } else { $page = 1; } // start fetching from this row number $offset = ($page - 1) * $itemPerPage; return $sql . " LIMIT $offset, $itemPerPage"; } /* Get the links to navigate between...
| |
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
| |
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |