Date | page | show
On the Internet, you will often see the current date on some pages, such as: "Today is x year x month x day X" and so on. To display the current date of the system, generally using the scripting language VBScript or JavaScript, the two languages have their own characteristics, especially in web teaching, through the use of these two languages and contrast, can achieve better teaching results, more can achieve the role of extrapolate, are introduced respectively their design process.
First, the use of VBScript scripting language
Displays the current date of the system in the VBScript scripting language, typically using the date and time functions provided internally:
date--Return System date
Weekday (x)--Return date x is the day of the week
Year (x)--back to date X
Month (x)--Returns the month of date X
Day (x)--Returns the date of date X
When you enter HTML editing at design time, insert the following code where you want to display the date:
Second, the use of JavaScript scripting language
The JavaScript scripting language is used to display the current date of the system, usually using the Date object provided internally, which can be used to handle actions on dates and times. Use the following methods in the Date object to display the date:
GetDate ()--Get the current date
Getday ()--Get the current week
GetMonth ()--Get the current month
GetYear ()--Get the current year
When you enter HTML editing at design time, insert the following code where you want to display the date:
Both of these methods can display the current date of the system, they have unique characteristics, strengths. Obviously, VBScript and JavaScript scripting languages are significantly different in format, and beginners can easily confuse them, resulting in a serious format error in the program.
In web design, the use of scripting language is a major difficulty, so, in teaching, let students use the above two methods to make, let them to distinguish between the similarities and differences between the two languages, personally to understand the magical script language. This will greatly help students to use the scripting language flexibly, so as to improve their ability of language analysis, improve their interest in learning Web pages, and get better teaching results.