473,405 Members | 2,272 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

displaying the value of a function.

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

Jul 20 '05 #1
1 3779
ok you just need to add the string to the html code
var date = getDateStr()
this.wwrite("<body topmargin='0' leftmargin='0'>" + date + "</body>");

"Graham Mattingley" <gr****@technocom.com> wrote in message
news:bi*******************@news.demon.co.uk...
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

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: JimJones | last post by:
Hey, I don't really know much about ASP but I need some help modifying the way a field is currently displayed. Currently the ASP code inside my page is simply: <%=rs.Fields("Notes")%> ...
2
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control...
19
by: Melvin G. Sheppers | last post by:
I want to display the time in a particular timezone (US Central) regardless where the computer is located. I have written the script below which displays the time in the Eastern, Central, Mountain,...
0
by: movieknight | last post by:
Hi, I have a class which I am feeding to the propertygrid, and I am exposing a Mesh object from my class for the propertygrid to display. I want the propertygrid to show the values (when you...
1
by: mandakini | last post by:
Hello freinds I am working on this url http://72.36.156.243/compbuild.php Here I am using ifram and displaying dynamic value I don't know how to use iframe as array how to assign array and...
1
by: anatak | last post by:
Hello I have function that generates a list op options for a select dropdown box here is the function I am pretty sure that the problem is situated in the new Option() function function...
33
by: buss123 | last post by:
Hi all, combo box script code was working in IE perfectly with all modes but OnChange event was not working in FireFox(editable mode, if we select valuese that combo box values r...
1
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being...
482
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
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,...
0
jinu1996
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...
0
agi2029
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,...
0
isladogs
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.