Clock ads jump status bar, such as JS code

Source: Internet
Author: User
Tags date current time return time interval
js| Advertising 1, to determine whether the Web page is expired getTime ()
Used to implement advertising expiration.

<script>
<!--
Today = new Date ()//Get current time
Theday = new Date (2005,12,31)//End time 2006/1/4 00:00:00
If Today.gettime () > Theday.gettime ()
if (Today.gettime () >theday.gettime ())
{
document.write (' Else
{
document.write (' <font size=5> your page has not expired .</font> ')
}
-->
</script>

2. Online clock instance settimeout () function
<script>
<!--
function Showtime ()
{
Document. CLOCK. Alarm.value = new Date (). ToString ()
Timerid = settimeout ("Showtime ()", 1000)
}
-->
</script>
<body >
<form name= "CLOCK" >
<input name= "ALARM" type= "text" size= "value=" ">
If no effect, please refresh
</form>
</body>
Where: settimeout () function
Timerid = settimeout (' Showtime ', 1000)
Refresh time interval 1000=1 seconds with settimeout
3, the Status window with function State Bar prompts
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title> Untitled Document </title>
<script>
<!--
Window.defaultstatus= "This is the homepage"
-->
</script>
<body>
<a href= "abc.htm" onmouseover= ' window.status= ' abc.htm '; return True ' >abc</a><br>
<a href= "def.htm" onmouseover= ' window.status= ' def.htm '; return True ' >def</a>
</body>
4, settimeout function, automatic link to the new website
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<script language= "JavaScript" >
<!--
function redir ()
{
A = "http://homepage.yesky.com"//Enter the URL of the new website
Timerid=settimeout (' Window.location.href=a ', 2000)
}
-->
</script>
<body >
Our website is moving to a new home! Please click the hyperlink below to enter our new website <br>
<a href= "http://homepage.yesky.com" > website tao </a>
<br> 2 seconds to automatically enter the new website, please wait patiently.
</body>

5. Examples of advertising subtitles
<script>
<!--
var showstring = ""
+ "Space,the Final frontier ... These are the "
+ "Voyages of the starship Enterprise, its"
+ "Continuing mission:to explore Strange"
+ "New worlds, to seek out new life and new"
+ "civilizatins, to boldly go where no mans"
+ "has gone before.______________________________"


+ "The universe, the ultimate boundary of mankind ...." Spaceship Enterprise's Journey, "
+ "is to explore the strange new World, the search for fresh life and new civilization, Yong"
+ "Sailing to the realm of human footprint."
//--------------------------------
var showwidth = 50
var showhead = 0
var showtail = Showwidth
var showlength= showstring.length
//--------------------------------
Function Marquee ()
{
var displaystring
if (Showhead<showtail)
displaystring = showstring.substring (showhead,showtail)
Else
displaystring = showstring.substring (showhead,showlength)
+showstring.substring (0,showtail)
//--------------------------------
Showhead = (showhead + 2)% Showlength
Showtail = (showtail + 2)% Showlength
//--------------------------------
Document. RUNNING. Showpad.value = displaystring
//--------------------------------
Timerid = settimeout ("marquee ()", 300)
}
->
</script>
<body >
<center>
<form name= "RUNNING" >
<input name= "Showpad" size=40 type= "text" value= "" >
If no effect, please refresh.
</form>
</center>
</body>
Description
Set 0.3 seconds to call the Marquee () function again
Timerid = settimeout ("marquee ()", 300)
Advertising subtitle Triggering event
<body >



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.