SlideShare a Scribd company logo
1 of 10
Bài Tập 1
Tạo Giao Diện Như Sau
Yêu cầu :
Khi Click chuột vào Radio Button thì có các thông điệp (Message) tương ứng
Bài tập 2 Hãy tạo một chương trình máy tính điện tử như sau :
Bài tập 3
Tạo một chương trình mô tả Lịch để bàn như sau :
Bài tập 4 Viết chương trình cho phép link dến một trang Web khác trong đó cho phép tuỳ chọn các đối
tượng Window
Bài tập 5
Tạo dòng chữ chạy trong TextBox
Bài tập 6
Tạo ngày tháng chạy trên thanh trạng thái
Bài tập 7
Tạo dòng chữ chạy trên thanh trạng thái:
Welcome to Total..
1/ Code
<FORM>
<p>
1:
<INPUT TYPE="radio" N AME="radio" value="Bạn chọn số 1" onClick="alert(value)">
2:
<INPUT TYPE="radio" N AME="radio" value=" Bạn chọn số 2 " onClick="alert(value)">
3:
<INPUT TYPE="radio" N AME="radio" value=" Bạn chọn số 3” onClick="alert(value)" >
</form>
2/ Code
<head><script LANGUAGE="JavaScript">
function a_plus_b(form) {
a=eval(form.a.value)
b=eval(form.b.value)
c=a+b
form.ans.value = c
}
function a_minus_b(form) {
a=eval(form.a.value)
b=eval(form.b.value)
c=a-b
form.ans.value=c
}
function a_times_b(form) {
a=eval(form.a.value)
b=eval(form.b.value)
c=a*b
form.ans.value=c
}
function a_div_b(form) {
a=eval(form.a.value)
b=eval(form.b.value)
c=a/b
form.ans.value = c
}
function a_pow_b(form) {
a=eval(form.a.value)
b=eval(form.b.value)
c=Math.pow(a, b)
form.ans.value = c
}
</script>
<title>E:buttonwindowsizer_.htm</title>
</head>
<body>
<form name="formx">
<p><input type="text" size="4" value="12" name="a"> <input type="button" value=" + "
onClick="a_plus_b(this.form)"> <input type="button" value=" - "
onClick="a_minus_b(this.form)"> <input type="button" value=" x "
onClick="a_times_b(this.form)"> <input type="button" value=" / "
onClick="a_div_b(this.form)"> <input type="button" value=" ^ "
onClick="a_pow_b(this.form)"> <input type="number" size="4" value="3" name="b"> =
<input
type "number" value="0" name="ans" size="9"> </p>
</form>
3/ Code
<title>Next Step Software - Java Script Number - 14</title>
<meta name="GENERATOR" content="(c) 1998 Copyright Next Step Software">
</head>
<body>
<script LANGUAGE="JavaScript">
<!-- Begin
monthnames = new Array("January","Februrary","March","April","May","June",
"July","August","September","October","N ovember","Decemeber");
var linkcount=0;
function addlink(month, day, href) {
var entry = new Array(3);
entry[0] = month;
entry[1] = day;
entry[2] = href;
this[linkcount++] = entry;
}
Array.prototype.addlink = addlink;
linkdays = new Array();
monthdays = new Array(12);
monthdays[0]=31;
monthdays[1]=28;
monthdays[2]=31;
monthdays[3]=30;
monthdays[4]=31;
monthdays[5]=30;
monthdays[6]=31;
monthdays[7]=31;
monthdays[8]=30;
monthdays[9]=31;
monthdays[10]=30;
monthdays[11]=31;
todayDate=new Date();
thisday=todayDate.getDay();
thismonth=todayDate.getMonth();
thisdate=todayDate.getDate();
thisyear=todayDate.getYear();
thisyear = thisyear % 100;
thisyear = ((thisyear < 50) ? (2000 + thisyear) : (1900 + thisyear));
if (((thisyear % 4 == 0)
&& !(thisyear % 100 == 0))
||(thisyear % 400 == 0)) monthdays[1]++;
startspaces=thisdate;
while (startspaces > 7) startspaces-=7;
startspaces = thisday - startspaces + 1;
if (startspaces < 0) startspaces+=7;
document.write("<table border=2 bgcolor=white ");
document.write("bordercolor=black><font color=black>");
document.write("<tr><td colspan=7><center><strong>"
+ monthnames[thismonth] + " " + thisyear
+ "</strong></center></font></td></tr>");
document.write("<tr>");
document.write("<td align=center>Su</td>");
document.write("<td align=center>M</td>");
document.write("<td align=center>Tu</td>");
document.write("<td align=center>W</td>");
document.write("<td align=center>Th</td>");
document.write("<td align=center>F</td>");
document.write("<td align=center>Sa</td>");
document.write("</tr>");
document.write("<tr>");
for (s=0;s<startspaces;s++) {
document.write("<td> </td>");
}
count=1;
while (count <= monthdays[thismonth]) {
for (b = startspaces;b<7;b++) {
linktrue=false;
document.write("<td>");
for (c=0;c<linkdays.length;c++) {
if (linkdays[c] != null) {
if ((linkdays[c][0]==thismonth + 1) && (linkdays[c][1]==count)) {
document.write("<a href="" + linkdays[c][2] + "">");
linktrue=true;
}
}
}
if (count==thisdate) {
document.write("<font color='FF0000'><strong>");
}
if (count <= monthdays[thismonth]) {
document.write(count);
}
else {
document.write(" ");
}
if (count==thisdate) {
document.write("</strong></font>");
}
if (linktrue)
document.write("</a>");
document.write("</td>");
count++;
}
document.write("</tr>");
document.write("<tr>");
startspaces=0;
}
document.write("</table></p>");
// End -->
4/ code
<HEAD>
<SCRIPT LAN GUAGE="JavaScript">
<!-- Begin
function customize(form) {
var address = document.form1.url.value;
var op_tool = (document.form1.tool.checked== true) ? 1 : 0;
var op_loc_box = (document.form1.loc_box.checked == true) ? 1 : 0;
var op_dir = (document.form1.dir.checked == true) ? 1 : 0;
var op_stat = (document.form1.stat.checked == true) ? 1 : 0;
var op_menu = (document.form1.menu.checked == true) ? 1 : 0;
var op_scroll = (document.form1.scroll.checked == true) ? 1 : 0;
var op_resize = (document.form1.resize.checked == true) ? 1 : 0;
var op_wid = document.form1.wid.value;
var op_heigh = document.form1.heigh.value;
var option = "toolbar="+ op_tool +",location="+ op_loc_box +",directories="
+ op_dir +",status="+ op_stat +",menubar="+ op_menu +",scrollbars="
+ op_scroll +",resizable=" + op_resize +",width=" + op_wid +",height="+ op_heigh;
var win3 = window.open("", "what_I_want", option);
var win4 = window.open(address, "what_I_want");
}
function clear(form) {
document.form1.wid.value="";
document.form1.heigh.value="";
}
// End -->
</SCRIPT>
<BODY>
<CEN TER>
<h4>Please choose from the following selections to customize your window</h4>
<br>
<TABLE cellpadding=5 border><TR><TD><PRE>
<FORM name=form1 ACTION ="javascript:" METHOD="POST">
<IN PUT TYPE="text" N AME="url" value="http://www.geocities.com" >: URL
<IN PUT TYPE="checkbox" N AME="tool">: Toolbar
<IN PUT TYPE="checkbox" N AME="loc_box">: Location
<IN PUT TYPE="checkbox" N AME="dir">: Directories
<IN PUT TYPE="checkbox" N AME="stat">: Status
<IN PUT TYPE="checkbox" N AME="menu">: Menubar
<IN PUT TYPE="checkbox" N AME="scroll">: Scrollbars
<IN PUT TYPE="checkbox" N AME="resize">: Resizable
<IN PUT TYPE="text" N AME="wid" value= >: Width
<IN PUT TYPE="text" N AME="heigh" value=>: Height
<BR><CENTER>
<IN PUT TYPE="button" VALUE="=EN TER=" OnClick="customize(this.form)">
<IN PUT TYPE="reset" VALUE="=RESET=" onClick="clear(this.form)">
</PRE></TD></TR></TABLE>
</FORM>
</CEN TER>
5/ Code
<script language="JavaScript">
<!-- begin
var max=0;
function textlist()
{
max=textlist.arguments.length;
for (i=0; i<max; i++)
this[i]=textlist.arguments[i];
}
tl=new textlist
(
"This is a message",
"Another one",
"And this will be the third",
"And the fourth is the last !"
);
var x=0; pos=0;
var l=tl[0].length;
function textticker()
{
document.tickform.tickfield.value=tl[x].substring(0,pos)+"_";
if(pos++==l) { pos=0; setTimeout("textticker()",1000); x++;
if(x==max) x=0; l=tl[x].length; } else
setTimeout("textticker()",50);
}
// end -->
</script>
<html>
<head>
<title>E:javascriptsscrollsclassic_.htm</title>
</head>
<body onLoad="textticker()">
<form name="tickform">
<p><input type="text" name="tickfield" size="40"></p>
</form>
</body>
</html>
6/ Code
<!-- Begin
function scrollit(seed) {
var m1 = "Welcome to Total JavaScript 99! ";
var m2 = "..... You can find all the scripts you need here! ";
var m3 = "......Enjoy ";
var m4 = "";
var msg=m1+m2+m3+m4;
var out = " ";
var c = 1;
if (seed > 100) {
seed--;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 100 && seed > 0) {
for (c=0 ; c < seed ; c++) {
out+=" ";
}
out+=msg;
seed--;
window.status=out;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 0) {
if (-seed < msg.length) {
out+=msg.substring(-seed,msg.length);
seed--;
window.status=out;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else {
window.status=" ";
timerTwo=window.setTimeout("scrollit(100)",75);
}
}
}
// End -->
</script>
<title></title>
</head>
<body onLoad="scrollit(100)">
</body>
7/ Code
<!-- Begin
var osd = " "
osd +="This is yet another JavaScript Scroll example ";
osd +="from the good folks at The JavaScript Source. ";
osd +="This one has the date and time at the front.";
osd +="Did you notice? It's coming around again, look! ";
osd +=" ";
var timer;
var msg = "";
function scrollMaster () {
msg = customDateSpring(new Date())
clearTimeout(timer)
msg += " " + showtime() + " " + osd
for (var i= 0; i < 100; i++){
msg = " " + msg;
}
scrollMe()
}
function scrollMe(){
window.status = msg;
msg = msg.substring(1, msg.length) + msg.substring(0,1);
timer = setTimeout("scrollMe()", 200);
}
function showtime (){
var now = new Date();
var hours= now.getHours();
var minutes= now.getMinutes();
var seconds= now.getSeconds();
var months= now.getMonth();
var dates= now.getDate();
var years= now.getYear();
var timeValue = ""
timeValue += ((months >9) ? "" : " ")
timeValue += ((dates >9) ? "" : " ")
timeValue = ( months +1)
timeValue +="/"+ dates
timeValue +="/"+ years
var ap="A.M."
if (hours == 12) {
ap = "P.M."
}
if (hours == 0) {
hours = 12
}
if(hours >= 13){
hours -= 12;
ap="P.M."
}
var timeValue2 = " " + hours
timeValue2 += ((minutes < 10) ? ":0":":") + minutes + " " + ap
return timeValue2;
}
function MakeArray(n) {
this.length = n
return this
}
monthN ames = new MakeArray(12)
monthN ames[1] = "Janurary"
monthN ames[2] = "February"
monthN ames[3] = "March"
monthN ames[4] = "April"
monthN ames[5] = "May"
monthN ames[6] = "June"
monthN ames[7] = "July"
monthN ames[8] = "August"
monthN ames[9] = "Sept."
monthN ames[10] = "Oct."
monthN ames[11] = "N ov."
monthN ames[12] = "Dec."
daysN ames = new MakeArray(7)
daysN ames[1] = "Sunday"
daysN ames[2] = "Monday"
daysN ames[3] = "Tuesday"
daysN ames[4] = "Wednesday"
daysN ames[5] = "Thursday"
daysN ames[6] = "Friday"
daysN ames[7] = "Saturday"
function customDateSpring(oneDate) {
var theDay = daysN ames[oneDate.getDay() +1]
var theDate =oneDate.getDate()
var theMonth = monthN ames[oneDate.getMonth() +1]
var dayth="th"
if ((theDate == 1) || (theDate == 21) || (theDate == 31)) {
dayth="st";
}
if ((theDate == 2) || (theDate ==22)) {
dayth="nd";
}
if ((theDate== 3) || (theDate == 23)) {
dayth="rd";
}
return theDay + ", " + theMonth + " " + theDate + dayth + ","
}
scrollMaster();
// End -->
scrollMaster();
// End -->

More Related Content

What's hot

The Ring programming language version 1.3 book - Part 34 of 88
The Ring programming language version 1.3 book - Part 34 of 88The Ring programming language version 1.3 book - Part 34 of 88
The Ring programming language version 1.3 book - Part 34 of 88Mahmoud Samir Fayed
 
The Ring programming language version 1.2 book - Part 32 of 84
The Ring programming language version 1.2 book - Part 32 of 84The Ring programming language version 1.2 book - Part 32 of 84
The Ring programming language version 1.2 book - Part 32 of 84Mahmoud Samir Fayed
 
The Ring programming language version 1.5.4 book - Part 44 of 185
The Ring programming language version 1.5.4 book - Part 44 of 185The Ring programming language version 1.5.4 book - Part 44 of 185
The Ring programming language version 1.5.4 book - Part 44 of 185Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 41 of 181
The Ring programming language version 1.5.2 book - Part 41 of 181The Ring programming language version 1.5.2 book - Part 41 of 181
The Ring programming language version 1.5.2 book - Part 41 of 181Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 42 of 184
The Ring programming language version 1.5.3 book - Part 42 of 184The Ring programming language version 1.5.3 book - Part 42 of 184
The Ring programming language version 1.5.3 book - Part 42 of 184Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 44 of 184
The Ring programming language version 1.5.3 book - Part 44 of 184The Ring programming language version 1.5.3 book - Part 44 of 184
The Ring programming language version 1.5.3 book - Part 44 of 184Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 46 of 189
The Ring programming language version 1.6 book - Part 46 of 189The Ring programming language version 1.6 book - Part 46 of 189
The Ring programming language version 1.6 book - Part 46 of 189Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 49 of 202
The Ring programming language version 1.8 book - Part 49 of 202The Ring programming language version 1.8 book - Part 49 of 202
The Ring programming language version 1.8 book - Part 49 of 202Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 52 of 212
The Ring programming language version 1.10 book - Part 52 of 212The Ring programming language version 1.10 book - Part 52 of 212
The Ring programming language version 1.10 book - Part 52 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 43 of 181
The Ring programming language version 1.5.2 book - Part 43 of 181The Ring programming language version 1.5.2 book - Part 43 of 181
The Ring programming language version 1.5.2 book - Part 43 of 181Mahmoud Samir Fayed
 
The Ring programming language version 1.5.4 book - Part 42 of 185
The Ring programming language version 1.5.4 book - Part 42 of 185The Ring programming language version 1.5.4 book - Part 42 of 185
The Ring programming language version 1.5.4 book - Part 42 of 185Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 54 of 212
The Ring programming language version 1.10 book - Part 54 of 212The Ring programming language version 1.10 book - Part 54 of 212
The Ring programming language version 1.10 book - Part 54 of 212Mahmoud Samir Fayed
 

What's hot (17)

The Ring programming language version 1.3 book - Part 34 of 88
The Ring programming language version 1.3 book - Part 34 of 88The Ring programming language version 1.3 book - Part 34 of 88
The Ring programming language version 1.3 book - Part 34 of 88
 
Java script
Java scriptJava script
Java script
 
The Ring programming language version 1.2 book - Part 32 of 84
The Ring programming language version 1.2 book - Part 32 of 84The Ring programming language version 1.2 book - Part 32 of 84
The Ring programming language version 1.2 book - Part 32 of 84
 
The Ring programming language version 1.5.4 book - Part 44 of 185
The Ring programming language version 1.5.4 book - Part 44 of 185The Ring programming language version 1.5.4 book - Part 44 of 185
The Ring programming language version 1.5.4 book - Part 44 of 185
 
The Ring programming language version 1.5.2 book - Part 41 of 181
The Ring programming language version 1.5.2 book - Part 41 of 181The Ring programming language version 1.5.2 book - Part 41 of 181
The Ring programming language version 1.5.2 book - Part 41 of 181
 
Computer practicals(part) Class 12
Computer practicals(part) Class 12Computer practicals(part) Class 12
Computer practicals(part) Class 12
 
Lekcja stylu
Lekcja styluLekcja stylu
Lekcja stylu
 
The Ring programming language version 1.5.3 book - Part 42 of 184
The Ring programming language version 1.5.3 book - Part 42 of 184The Ring programming language version 1.5.3 book - Part 42 of 184
The Ring programming language version 1.5.3 book - Part 42 of 184
 
Mobile Web 5.0
Mobile Web 5.0Mobile Web 5.0
Mobile Web 5.0
 
The Ring programming language version 1.5.3 book - Part 44 of 184
The Ring programming language version 1.5.3 book - Part 44 of 184The Ring programming language version 1.5.3 book - Part 44 of 184
The Ring programming language version 1.5.3 book - Part 44 of 184
 
The Ring programming language version 1.6 book - Part 46 of 189
The Ring programming language version 1.6 book - Part 46 of 189The Ring programming language version 1.6 book - Part 46 of 189
The Ring programming language version 1.6 book - Part 46 of 189
 
Groovy kind of test
Groovy kind of testGroovy kind of test
Groovy kind of test
 
The Ring programming language version 1.8 book - Part 49 of 202
The Ring programming language version 1.8 book - Part 49 of 202The Ring programming language version 1.8 book - Part 49 of 202
The Ring programming language version 1.8 book - Part 49 of 202
 
The Ring programming language version 1.10 book - Part 52 of 212
The Ring programming language version 1.10 book - Part 52 of 212The Ring programming language version 1.10 book - Part 52 of 212
The Ring programming language version 1.10 book - Part 52 of 212
 
The Ring programming language version 1.5.2 book - Part 43 of 181
The Ring programming language version 1.5.2 book - Part 43 of 181The Ring programming language version 1.5.2 book - Part 43 of 181
The Ring programming language version 1.5.2 book - Part 43 of 181
 
The Ring programming language version 1.5.4 book - Part 42 of 185
The Ring programming language version 1.5.4 book - Part 42 of 185The Ring programming language version 1.5.4 book - Part 42 of 185
The Ring programming language version 1.5.4 book - Part 42 of 185
 
The Ring programming language version 1.10 book - Part 54 of 212
The Ring programming language version 1.10 book - Part 54 of 212The Ring programming language version 1.10 book - Part 54 of 212
The Ring programming language version 1.10 book - Part 54 of 212
 

Viewers also liked

Mbox to pst tool
Mbox to pst toolMbox to pst tool
Mbox to pst toolskysky01
 
Superdeportivos Cantabria english program 2014
Superdeportivos Cantabria english program 2014Superdeportivos Cantabria english program 2014
Superdeportivos Cantabria english program 2014SDCInternational
 
öRüntü ve süslemeler
öRüntü ve süslemeleröRüntü ve süslemeler
öRüntü ve süslemelersnasn
 
Faithful unto death 3
Faithful unto death 3Faithful unto death 3
Faithful unto death 3Normanbaker2
 
La verdadera amistad
La verdadera amistadLa verdadera amistad
La verdadera amistadBetty Londo
 
Glaucoma & target iop
Glaucoma & target iopGlaucoma & target iop
Glaucoma & target iopdoseiha5
 
Fotos cumple lucia
Fotos cumple luciaFotos cumple lucia
Fotos cumple luciaErika Peña
 
Kt10 ct 16 nguyen cong duc 19 phan hau giang 68 nguyen minh tuan nha hat guan...
Kt10 ct 16 nguyen cong duc 19 phan hau giang 68 nguyen minh tuan nha hat guan...Kt10 ct 16 nguyen cong duc 19 phan hau giang 68 nguyen minh tuan nha hat guan...
Kt10 ct 16 nguyen cong duc 19 phan hau giang 68 nguyen minh tuan nha hat guan...Nguyễn Tuấn
 
Talleres intern manteles
Talleres intern mantelesTalleres intern manteles
Talleres intern mantelesErika Peña
 

Viewers also liked (17)

Cumple andrew
Cumple andrewCumple andrew
Cumple andrew
 
Cumple andrew
Cumple andrewCumple andrew
Cumple andrew
 
Mbox to pst tool
Mbox to pst toolMbox to pst tool
Mbox to pst tool
 
Fifty pages of my work
Fifty pages of my workFifty pages of my work
Fifty pages of my work
 
Superdeportivos Cantabria english program 2014
Superdeportivos Cantabria english program 2014Superdeportivos Cantabria english program 2014
Superdeportivos Cantabria english program 2014
 
öRüntü ve süslemeler
öRüntü ve süslemeleröRüntü ve süslemeler
öRüntü ve süslemeler
 
Guidorizzi vol2
Guidorizzi vol2Guidorizzi vol2
Guidorizzi vol2
 
PIGMENT 2014
PIGMENT 2014PIGMENT 2014
PIGMENT 2014
 
Faithful unto death 3
Faithful unto death 3Faithful unto death 3
Faithful unto death 3
 
La verdadera amistad
La verdadera amistadLa verdadera amistad
La verdadera amistad
 
Glaucoma & target iop
Glaucoma & target iopGlaucoma & target iop
Glaucoma & target iop
 
Bab 9 forecasting
Bab 9 forecastingBab 9 forecasting
Bab 9 forecasting
 
Cumple daniel
Cumple danielCumple daniel
Cumple daniel
 
Cumple marco
Cumple marcoCumple marco
Cumple marco
 
Fotos cumple lucia
Fotos cumple luciaFotos cumple lucia
Fotos cumple lucia
 
Kt10 ct 16 nguyen cong duc 19 phan hau giang 68 nguyen minh tuan nha hat guan...
Kt10 ct 16 nguyen cong duc 19 phan hau giang 68 nguyen minh tuan nha hat guan...Kt10 ct 16 nguyen cong duc 19 phan hau giang 68 nguyen minh tuan nha hat guan...
Kt10 ct 16 nguyen cong duc 19 phan hau giang 68 nguyen minh tuan nha hat guan...
 
Talleres intern manteles
Talleres intern mantelesTalleres intern manteles
Talleres intern manteles
 

Similar to Baitap tkw

Big Data for each one of us
Big Data for each one of usBig Data for each one of us
Big Data for each one of usOSCON Byrum
 
JavaScript Advanced - Useful methods to power up your code
JavaScript Advanced - Useful methods to power up your codeJavaScript Advanced - Useful methods to power up your code
JavaScript Advanced - Useful methods to power up your codeLaurence Svekis ✔
 
JavaOne2010 Groovy/Spring Roo
JavaOne2010 Groovy/Spring RooJavaOne2010 Groovy/Spring Roo
JavaOne2010 Groovy/Spring RooYasuharu Nakano
 
Dynamic HTML Event Model
Dynamic HTML Event ModelDynamic HTML Event Model
Dynamic HTML Event ModelReem Alattas
 
A la découverte de TypeScript
A la découverte de TypeScriptA la découverte de TypeScript
A la découverte de TypeScriptDenis Voituron
 
JavaScript Objects and OOP Programming with JavaScript
JavaScript Objects and OOP Programming with JavaScriptJavaScript Objects and OOP Programming with JavaScript
JavaScript Objects and OOP Programming with JavaScriptLaurence Svekis ✔
 
Acceptance Testing with Webrat
Acceptance Testing with WebratAcceptance Testing with Webrat
Acceptance Testing with WebratLuismi Cavallé
 
CS101- Introduction to Computing- Lecture 35
CS101- Introduction to Computing- Lecture 35CS101- Introduction to Computing- Lecture 35
CS101- Introduction to Computing- Lecture 35Bilal Ahmed
 
code hay cho blogspot
code hay cho blogspotcode hay cho blogspot
code hay cho blogspotHuy Nguyen
 
FYBSC IT Web Programming Unit III Core Javascript
FYBSC IT Web Programming Unit III  Core JavascriptFYBSC IT Web Programming Unit III  Core Javascript
FYBSC IT Web Programming Unit III Core JavascriptArti Parab Academics
 
JavaScript Functions
JavaScript Functions JavaScript Functions
JavaScript Functions Reem Alattas
 
Cara membuat tulisan mengikuti kursor di blog
Cara membuat tulisan mengikuti kursor di blogCara membuat tulisan mengikuti kursor di blog
Cara membuat tulisan mengikuti kursor di blogAkhmad Akbar
 
Date difference[1]
Date difference[1]Date difference[1]
Date difference[1]shafiullas
 

Similar to Baitap tkw (20)

Webtechnology lab
Webtechnology labWebtechnology lab
Webtechnology lab
 
Groovy kind of test
Groovy kind of testGroovy kind of test
Groovy kind of test
 
JavaScript Refactoring
JavaScript RefactoringJavaScript Refactoring
JavaScript Refactoring
 
Big Data for each one of us
Big Data for each one of usBig Data for each one of us
Big Data for each one of us
 
JavaScript Advanced - Useful methods to power up your code
JavaScript Advanced - Useful methods to power up your codeJavaScript Advanced - Useful methods to power up your code
JavaScript Advanced - Useful methods to power up your code
 
JavaOne2010 Groovy/Spring Roo
JavaOne2010 Groovy/Spring RooJavaOne2010 Groovy/Spring Roo
JavaOne2010 Groovy/Spring Roo
 
Dynamic HTML Event Model
Dynamic HTML Event ModelDynamic HTML Event Model
Dynamic HTML Event Model
 
JQuery Flot
JQuery FlotJQuery Flot
JQuery Flot
 
A la découverte de TypeScript
A la découverte de TypeScriptA la découverte de TypeScript
A la découverte de TypeScript
 
JavaScript Objects and OOP Programming with JavaScript
JavaScript Objects and OOP Programming with JavaScriptJavaScript Objects and OOP Programming with JavaScript
JavaScript Objects and OOP Programming with JavaScript
 
Acceptance Testing with Webrat
Acceptance Testing with WebratAcceptance Testing with Webrat
Acceptance Testing with Webrat
 
CS101- Introduction to Computing- Lecture 35
CS101- Introduction to Computing- Lecture 35CS101- Introduction to Computing- Lecture 35
CS101- Introduction to Computing- Lecture 35
 
code hay cho blogspot
code hay cho blogspotcode hay cho blogspot
code hay cho blogspot
 
FYBSC IT Web Programming Unit III Core Javascript
FYBSC IT Web Programming Unit III  Core JavascriptFYBSC IT Web Programming Unit III  Core Javascript
FYBSC IT Web Programming Unit III Core Javascript
 
Django quickstart
Django quickstartDjango quickstart
Django quickstart
 
JavaScript Functions
JavaScript Functions JavaScript Functions
JavaScript Functions
 
Cara membuat tulisan mengikuti kursor di blog
Cara membuat tulisan mengikuti kursor di blogCara membuat tulisan mengikuti kursor di blog
Cara membuat tulisan mengikuti kursor di blog
 
Web Technology Record
Web Technology RecordWeb Technology Record
Web Technology Record
 
JavaScript Training
JavaScript TrainingJavaScript Training
JavaScript Training
 
Date difference[1]
Date difference[1]Date difference[1]
Date difference[1]
 

Recently uploaded

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 

Recently uploaded (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 

Baitap tkw

  • 1. Bài Tập 1 Tạo Giao Diện Như Sau Yêu cầu : Khi Click chuột vào Radio Button thì có các thông điệp (Message) tương ứng Bài tập 2 Hãy tạo một chương trình máy tính điện tử như sau : Bài tập 3 Tạo một chương trình mô tả Lịch để bàn như sau : Bài tập 4 Viết chương trình cho phép link dến một trang Web khác trong đó cho phép tuỳ chọn các đối tượng Window Bài tập 5 Tạo dòng chữ chạy trong TextBox Bài tập 6 Tạo ngày tháng chạy trên thanh trạng thái Bài tập 7 Tạo dòng chữ chạy trên thanh trạng thái: Welcome to Total..
  • 2. 1/ Code <FORM> <p> 1: <INPUT TYPE="radio" N AME="radio" value="Bạn chọn số 1" onClick="alert(value)"> 2: <INPUT TYPE="radio" N AME="radio" value=" Bạn chọn số 2 " onClick="alert(value)"> 3: <INPUT TYPE="radio" N AME="radio" value=" Bạn chọn số 3” onClick="alert(value)" > </form> 2/ Code <head><script LANGUAGE="JavaScript"> function a_plus_b(form) { a=eval(form.a.value) b=eval(form.b.value) c=a+b form.ans.value = c } function a_minus_b(form) { a=eval(form.a.value) b=eval(form.b.value) c=a-b form.ans.value=c } function a_times_b(form) { a=eval(form.a.value) b=eval(form.b.value) c=a*b form.ans.value=c } function a_div_b(form) { a=eval(form.a.value) b=eval(form.b.value) c=a/b form.ans.value = c } function a_pow_b(form) { a=eval(form.a.value) b=eval(form.b.value) c=Math.pow(a, b) form.ans.value = c } </script> <title>E:buttonwindowsizer_.htm</title> </head> <body>
  • 3. <form name="formx"> <p><input type="text" size="4" value="12" name="a"> <input type="button" value=" + " onClick="a_plus_b(this.form)"> <input type="button" value=" - " onClick="a_minus_b(this.form)"> <input type="button" value=" x " onClick="a_times_b(this.form)"> <input type="button" value=" / " onClick="a_div_b(this.form)"> <input type="button" value=" ^ " onClick="a_pow_b(this.form)"> <input type="number" size="4" value="3" name="b"> = <input type "number" value="0" name="ans" size="9"> </p> </form> 3/ Code <title>Next Step Software - Java Script Number - 14</title> <meta name="GENERATOR" content="(c) 1998 Copyright Next Step Software"> </head> <body> <script LANGUAGE="JavaScript"> <!-- Begin monthnames = new Array("January","Februrary","March","April","May","June", "July","August","September","October","N ovember","Decemeber"); var linkcount=0; function addlink(month, day, href) { var entry = new Array(3); entry[0] = month; entry[1] = day; entry[2] = href; this[linkcount++] = entry; } Array.prototype.addlink = addlink; linkdays = new Array(); monthdays = new Array(12); monthdays[0]=31; monthdays[1]=28; monthdays[2]=31; monthdays[3]=30; monthdays[4]=31; monthdays[5]=30; monthdays[6]=31; monthdays[7]=31; monthdays[8]=30; monthdays[9]=31; monthdays[10]=30; monthdays[11]=31; todayDate=new Date(); thisday=todayDate.getDay(); thismonth=todayDate.getMonth(); thisdate=todayDate.getDate(); thisyear=todayDate.getYear(); thisyear = thisyear % 100; thisyear = ((thisyear < 50) ? (2000 + thisyear) : (1900 + thisyear)); if (((thisyear % 4 == 0) && !(thisyear % 100 == 0)) ||(thisyear % 400 == 0)) monthdays[1]++; startspaces=thisdate; while (startspaces > 7) startspaces-=7; startspaces = thisday - startspaces + 1;
  • 4. if (startspaces < 0) startspaces+=7; document.write("<table border=2 bgcolor=white "); document.write("bordercolor=black><font color=black>"); document.write("<tr><td colspan=7><center><strong>" + monthnames[thismonth] + " " + thisyear + "</strong></center></font></td></tr>"); document.write("<tr>"); document.write("<td align=center>Su</td>"); document.write("<td align=center>M</td>"); document.write("<td align=center>Tu</td>"); document.write("<td align=center>W</td>"); document.write("<td align=center>Th</td>"); document.write("<td align=center>F</td>"); document.write("<td align=center>Sa</td>"); document.write("</tr>"); document.write("<tr>"); for (s=0;s<startspaces;s++) { document.write("<td> </td>"); } count=1; while (count <= monthdays[thismonth]) { for (b = startspaces;b<7;b++) { linktrue=false; document.write("<td>"); for (c=0;c<linkdays.length;c++) { if (linkdays[c] != null) { if ((linkdays[c][0]==thismonth + 1) && (linkdays[c][1]==count)) { document.write("<a href="" + linkdays[c][2] + "">"); linktrue=true; } } } if (count==thisdate) { document.write("<font color='FF0000'><strong>"); } if (count <= monthdays[thismonth]) { document.write(count); } else { document.write(" "); } if (count==thisdate) { document.write("</strong></font>"); } if (linktrue) document.write("</a>"); document.write("</td>"); count++; } document.write("</tr>"); document.write("<tr>"); startspaces=0; } document.write("</table></p>"); // End -->
  • 5. 4/ code <HEAD> <SCRIPT LAN GUAGE="JavaScript"> <!-- Begin function customize(form) { var address = document.form1.url.value; var op_tool = (document.form1.tool.checked== true) ? 1 : 0; var op_loc_box = (document.form1.loc_box.checked == true) ? 1 : 0; var op_dir = (document.form1.dir.checked == true) ? 1 : 0; var op_stat = (document.form1.stat.checked == true) ? 1 : 0; var op_menu = (document.form1.menu.checked == true) ? 1 : 0; var op_scroll = (document.form1.scroll.checked == true) ? 1 : 0; var op_resize = (document.form1.resize.checked == true) ? 1 : 0; var op_wid = document.form1.wid.value; var op_heigh = document.form1.heigh.value; var option = "toolbar="+ op_tool +",location="+ op_loc_box +",directories=" + op_dir +",status="+ op_stat +",menubar="+ op_menu +",scrollbars=" + op_scroll +",resizable=" + op_resize +",width=" + op_wid +",height="+ op_heigh; var win3 = window.open("", "what_I_want", option); var win4 = window.open(address, "what_I_want"); } function clear(form) { document.form1.wid.value=""; document.form1.heigh.value=""; } // End --> </SCRIPT> <BODY> <CEN TER> <h4>Please choose from the following selections to customize your window</h4> <br> <TABLE cellpadding=5 border><TR><TD><PRE> <FORM name=form1 ACTION ="javascript:" METHOD="POST"> <IN PUT TYPE="text" N AME="url" value="http://www.geocities.com" >: URL <IN PUT TYPE="checkbox" N AME="tool">: Toolbar <IN PUT TYPE="checkbox" N AME="loc_box">: Location <IN PUT TYPE="checkbox" N AME="dir">: Directories <IN PUT TYPE="checkbox" N AME="stat">: Status <IN PUT TYPE="checkbox" N AME="menu">: Menubar <IN PUT TYPE="checkbox" N AME="scroll">: Scrollbars <IN PUT TYPE="checkbox" N AME="resize">: Resizable <IN PUT TYPE="text" N AME="wid" value= >: Width <IN PUT TYPE="text" N AME="heigh" value=>: Height <BR><CENTER> <IN PUT TYPE="button" VALUE="=EN TER=" OnClick="customize(this.form)"> <IN PUT TYPE="reset" VALUE="=RESET=" onClick="clear(this.form)"> </PRE></TD></TR></TABLE> </FORM> </CEN TER> 5/ Code <script language="JavaScript"> <!-- begin var max=0; function textlist() { max=textlist.arguments.length;
  • 6. for (i=0; i<max; i++) this[i]=textlist.arguments[i]; } tl=new textlist ( "This is a message", "Another one", "And this will be the third", "And the fourth is the last !" ); var x=0; pos=0; var l=tl[0].length; function textticker() { document.tickform.tickfield.value=tl[x].substring(0,pos)+"_"; if(pos++==l) { pos=0; setTimeout("textticker()",1000); x++; if(x==max) x=0; l=tl[x].length; } else setTimeout("textticker()",50); } // end --> </script> <html> <head> <title>E:javascriptsscrollsclassic_.htm</title> </head> <body onLoad="textticker()"> <form name="tickform"> <p><input type="text" name="tickfield" size="40"></p> </form> </body> </html> 6/ Code <!-- Begin function scrollit(seed) { var m1 = "Welcome to Total JavaScript 99! "; var m2 = "..... You can find all the scripts you need here! "; var m3 = "......Enjoy "; var m4 = ""; var msg=m1+m2+m3+m4; var out = " "; var c = 1; if (seed > 100) { seed--; cmd="scrollit("+seed+")"; timerTwo=window.setTimeout(cmd,100); } else if (seed <= 100 && seed > 0) { for (c=0 ; c < seed ; c++) { out+=" "; } out+=msg; seed--; window.status=out; cmd="scrollit("+seed+")"; timerTwo=window.setTimeout(cmd,100); }
  • 7. else if (seed <= 0) { if (-seed < msg.length) { out+=msg.substring(-seed,msg.length); seed--; window.status=out; cmd="scrollit("+seed+")"; timerTwo=window.setTimeout(cmd,100); } else { window.status=" "; timerTwo=window.setTimeout("scrollit(100)",75); } } } // End --> </script> <title></title> </head> <body onLoad="scrollit(100)"> </body> 7/ Code <!-- Begin var osd = " " osd +="This is yet another JavaScript Scroll example "; osd +="from the good folks at The JavaScript Source. "; osd +="This one has the date and time at the front."; osd +="Did you notice? It's coming around again, look! "; osd +=" "; var timer; var msg = ""; function scrollMaster () { msg = customDateSpring(new Date()) clearTimeout(timer) msg += " " + showtime() + " " + osd for (var i= 0; i < 100; i++){ msg = " " + msg; } scrollMe() } function scrollMe(){ window.status = msg; msg = msg.substring(1, msg.length) + msg.substring(0,1); timer = setTimeout("scrollMe()", 200); } function showtime (){ var now = new Date(); var hours= now.getHours(); var minutes= now.getMinutes(); var seconds= now.getSeconds(); var months= now.getMonth(); var dates= now.getDate(); var years= now.getYear(); var timeValue = "" timeValue += ((months >9) ? "" : " ") timeValue += ((dates >9) ? "" : " ") timeValue = ( months +1)
  • 8. timeValue +="/"+ dates timeValue +="/"+ years var ap="A.M." if (hours == 12) { ap = "P.M." } if (hours == 0) { hours = 12 } if(hours >= 13){ hours -= 12; ap="P.M." } var timeValue2 = " " + hours timeValue2 += ((minutes < 10) ? ":0":":") + minutes + " " + ap return timeValue2; } function MakeArray(n) { this.length = n return this } monthN ames = new MakeArray(12) monthN ames[1] = "Janurary" monthN ames[2] = "February" monthN ames[3] = "March" monthN ames[4] = "April" monthN ames[5] = "May" monthN ames[6] = "June" monthN ames[7] = "July" monthN ames[8] = "August" monthN ames[9] = "Sept." monthN ames[10] = "Oct." monthN ames[11] = "N ov." monthN ames[12] = "Dec." daysN ames = new MakeArray(7) daysN ames[1] = "Sunday" daysN ames[2] = "Monday" daysN ames[3] = "Tuesday" daysN ames[4] = "Wednesday" daysN ames[5] = "Thursday" daysN ames[6] = "Friday" daysN ames[7] = "Saturday" function customDateSpring(oneDate) { var theDay = daysN ames[oneDate.getDay() +1] var theDate =oneDate.getDate() var theMonth = monthN ames[oneDate.getMonth() +1] var dayth="th" if ((theDate == 1) || (theDate == 21) || (theDate == 31)) { dayth="st"; } if ((theDate == 2) || (theDate ==22)) { dayth="nd"; } if ((theDate== 3) || (theDate == 23)) { dayth="rd"; } return theDay + ", " + theMonth + " " + theDate + dayth + "," }