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
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