In the .js file or the head script stream, enter the following code-
1> orddate = new Date();
2> dispdate = orddate.getMonth() + 1 + "-" + orddate.getDate() + "-" + orddate.getYear();
Further in the body stream of the html file the date can be displayed using the DOM innerHTML =+ dispdate or using the document.write method.
Addition: With the document.write method a table is being created displaying the order date. This can be in the init function of the js file. The code is as follows
- document.write('<html><body><table align="top" cellpadding="4" cellspacing="7">');
- document.write('<tr><td><font color="#ffffff" size="4" face="verdana">' + "The Order Date is: " + dispdate + '</font></td></tr>');
- document.write('<tr><td><font color="#ffffff" size="4" face="verdana">' + "The Delivery Date is 3 days from the order date" + '</font></td></tr>');
- document.write('</table></body></html>');
For more information visit abco technology training at ABCO Technology












Check Us Out We Are All Over The Web!!












Check Out Our Website
1 comment:
I try your code but I´m not able to display the date inside the table.
Post a Comment