-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemp.html
62 lines (47 loc) · 1.42 KB
/
temp.html
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<script>
if (!window.webkitNotifications) {
alert('Sorry , your browser does not support desktop notification. Try Google Chrome.');
}
function RequestPermission (callback)
{
window.webkitNotifications.requestPermission(callback);
}
function notification ()
{
if (window.webkitNotifications.checkPermission() > 0) {
RequestPermission(notification);
}
var icon = 'img/icon48.png';
var title = 'Manchester Utd vs Chelsea';
var body = 'Diddier Drogba broke the deadlock with an extraordinary effort from 30 yard volley shot!';
var popup = window.webkitNotifications.createNotification(icon, title, body);
popup.show();
setTimeout(function(){
popup.cancel();
}, '5000');
}
var obj;
function ajax_request()
{
obj=new XMLHttpRequest();
obj.open('get','live.html',true);
obj.onreadystatechange = ajax_fetch;
obj.send(null);
notification();
}
function ajax_fetch()
{
if (obj.readyState == 4)
{
var live_contents=obj.responseText;
document.getElementById('content').innerHTML=live_contents;
}
}
///var currentTime = new Date()
//v/ar month = currentTime.getMonth() + 1
//var day = currentTime.getDate()
//var year = currentTime.getFullYear()
//document.write(month + "/" + day + "/" + year)
</script>
<body onload='ajax_request()'>
<div id="content"></div>