Provides forward, rewind features and other JavaScript quick tips

Source: Internet
Author: User
Javascript| crash

By understanding some of the examples below and applying them to your web, you soon become a javascipt.
Example (i), adding the current time on the page

< script language= ' JavaScript ' >
Tdy=new Date ();
document.write (' Current time: ', tdy.gethours ());
document.write (': ', tdy.getminutes ());
document.write (': ', Tdy.getseconds ());


Example (ii), the date on which the page was added to the document last modified

< script language= ' JavaScript ' >
document.write (' last edited date of this page: ');
document.write (document.lastmodified)


Example (iii), displaying Mobile information in the window's Status prompt window
(1) before the body
< script language= ' JavaScript ' >
var msg= ' This is a state line scrolling display of the Javascipt program, interested comrades, can paste! '
var i=1
function Scroll ()
{
Mess=msg.substring (i,msg.length) + ' +msg.substring (0,i)
Window.status=mess
i++;
if (i>=msg.length) I=1;
settimeout (' scroll () ', 200);
}

(2) in the body tag:

Through the above two steps can be completed.

Example (iv), provide forward, back function
< form >
< input type= ' button ' value= ' <-'
> three page

Example (eight), getting browser properties
Navigator.appcodename=undefinednavigator.appname=microsoft Internet explorernavigator.appversion=4.0 (compatible; MSIE 5.0; Windows 98; Digext) navigator.appagent=undefined



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.