Thứ Hai, 4 tháng 6, 2012

Tạo script giới hạn thời gian xem một trang web



Đoạn script này sẽ giới hạn một người khách thăm trang web của bạn. Thời gian được đếm trên thanh trạng thái. Sau khi hết thời gian trình duyệt sẽ tự động chuyển tới trang khác
Trước tiên bạn hãy chèn vào phần <head> đoạn script dưới đây. Thay đổi thời gian tùy ý bạn. Ví dụ bạn muốn nhỏ hơn  1 phút (30 giây), hãy đổi thành 0:30. Nhớ sửa lại URL mà bạn muốn tự động chuyển đến theo  ý bạn.

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<script>
<!--
var limit="1:30"
if (document.images){
var parselimit=limit.split(":")
parselimit=parselimit[0]*60+parselimit[1]*1
}
function begintimer(){
if (!document.images)
return
if (parselimit==1)
window.location="http://www.vnn.vn/"
else{
parselimit-=1
curmin=Math.floor(parselimit/60)
cursec=parselimit%60
if (curmin!=0)
curtime=curmin+" minutes and "+cursec+" seconds left"
else
curtime=cursec+" seconds left"
window.status=curtime
setTimeout("begintimer()",1000)
}
}
//-->
</script>
Sau đó bạn hãy chèn thêm vào tag <body> như sau :
?
1
<body onLoad="begintimer()">
Chúc bạn thành công!
Tổng hợp
Share this post
  • Share to Facebook
  • Share to Twitter
  • Share to Google+
  • Share to Stumble Upon
  • Share to Evernote
  • Share to Blogger
  • Share to Email
  • Share to Yahoo Messenger
  • More...

0 nhận xét

:) :-) :)) =)) :( :-( :(( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ :-$ (b) (f) x-) (k) (h) (c) cheer

 
© Download do an khoa luan tai lieu
Designed by BlogThietKe Cooperated with Duy Pham
Released under Creative Commons 3.0 CC BY-NC 3.0
Posts RSSComments RSS
Back to top