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. In order 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, are introduced 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 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. The author thinks, in the webpage design, the script language application is a big difficulty, therefore, in the teaching, lets the student use above two kinds of methods to make, lets them distinguish the similarities and differences between two languages, personally to realize, understands the script language the magical use. 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. |