displaying the value of a function.

G

Graham Mattingley

Hi Group,

I am new to Javascript and would like to know who do the following, I
suspect it is quite easy..

I have a function
++++++++++++++++++++++++++++++++++++++++++++++++
function GetMonth(intMonth){
var MonthArray = new Array("Jan", "Feb", "Mar",
"Apr", "May", "Jun",
"Jul", "Aug", "Sep",
"Oct", "Nov", "Dec")
return MonthArray[intMonth]
}
function getDateStr(){
var today = new Date()
var year = today.getYear()
if(year<1000) year+=1900
var todayStr = GetMonth(today.getMonth()) + " " + today.getDate()
todayStr += ", " + year
return todayStr
}
++++++++++++++++++++++++++++++++++++++++++++++++++

and I want to display the value of the function using the
this.wwrite command

I want to add it to this code (this bulids a pop window), I want the date to
appear in the popup.

this.wwrite("<html>");
this.wwrite("<head><title>Calendar</title>");
this.wwrite("<body topmargin='0' leftmargin='0'>");
this.wwrite("</head>");


I tryed something like

var date = getDateStr()
this.wwrite date;

but this caused an error

Kind Regards

Graham Mattingley
 
S

steve stevo

ok you just need to add the string to the html code


var date = getDateStr()


this.wwrite("<body topmargin='0' leftmargin='0'>" + date + "</body>");
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,079
Messages
2,570,574
Members
47,207
Latest member
HelenaCani

Latest Threads

Top