-
Notifications
You must be signed in to change notification settings - Fork 0
/
project2.htm
120 lines (119 loc) · 6.38 KB
/
project2.htm
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Sports Connection - Alan Johnson</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en-us" />
<link href="myStyle_sports.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
/* <![CDATA[ */
var httpRequest = false;
function getRequestObject() {
try {
httpRequest = new XMLHttpRequest();
}
catch (requestError) {
try {
httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (requestError) {
try {
httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (requestError) {
window.alert("Your browser does not support AJAX!");
return false;
}
}
}
return httpRequest;
}
function newsUpdate() {
if (!httpRequest)
httpRequest = getRequestObject();
httpRequest.abort();
httpRequest.open("get","TopStories.php", true);
httpRequest.send(null);
httpRequest.onreadystatechange=fillNewsInfo;
var recentNews = setTimeout('newsUpdate()', 50000);
}
function fillNewsInfo() {
if(httpRequest.readyState==4 && httpRequest.status == 200) {
var news = httpRequest.responseXML;
document.getElementById("newsCell").innerHTML = ""
var newsItems=news.getElementsByTagName("item");
if (newsItems.length > 0) {
for (var i=0; i<newsItems.length; ++i) {
var curHeadline = newsItems[i].getElementsByTagName("title")[0].childNodes[0].nodeValue;
var curLink = newsItems[i].getElementsByTagName("link")[0].childNodes[0].nodeValue;
var curPubDate = newsItems[i].getElementsByTagName("pubDate")[0].childNodes[0].nodeValue;
var curDesc = newsItems[i].getElementsByTagName("description")[0].childNodes[0].nodeValue;
var curStory = "<a href='" + curLink + "'>" + curHeadline + "</a><br />";
curStory += "<span class='newsDate'>" + curPubDate + "</span><br />";
curStory += "<div class='newsDescription'>" + curDesc + "</div>";
document.getElementById("newsCell").innerHTML += curStory;
}
}
else
document.getElementById("newsCell").innerHTML = "RSS feed does not contain any items.";
}
}
/* ]]> */
</script>
</head>
<body onload="newsUpdate();">
<!-- Your page here -->
<div id="header">Sports Connection</div>
<div class="navBar">
<ul>
<li class="first"><a href="#" class="Nav">Football</a>
<ul>
<li><a href="http://www.nfl.com/" class="Nav">NFL.com</a></li>
<li><a href="http://www.football.com/" class="Nav">Football.com</a></li>
<li><a href="http://www.ncaafootball.com/" class="Nav">NCAAFootball.com</a></li>
</ul>
</li>
<li><a href="#" class="Nav">Baseball</a>
<ul>
<li><a href="http://mlb.mlb.com" class="Nav">MLB.com</a></li>
<li><a href="http://www.baseball-almanac.com/" class="Nav">Baseball-Almanac.com</a></li>
<li><a href="http://www.baseball-reference.com/" class="Nav">Baseball-Reference.com</a></li>
</ul>
</li>
<li><a href="#" class="Nav">Basketball</a>
<ul>
<li><a href="http://www.nba.com/" class="Nav">NBA.com</a></li>
<li><a href="http://www.basketball.com/" class="Nav">basketball.com</a></li>
<li><a href="http://www.usabasketball.com/" class="Nav">USAbasketball.com</a></li>
</ul>
</li>
<li><a href="#" class="Nav">Hockey</a>
<ul>
<li><a href="http://www.nhl.com/" class="Nav">NHL.com</a></li>
<li><a href="http://espn.go.com/nhl/" class="Nav">ESPN.com/NHL</a></li>
<li><a href="http://www.usahockey.com/" class="Nav">USAhockey.com</a></li>
</ul>
</li>
<li><a href="#" class="Nav">Soccer</a>
<ul>
<li><a href="http://www.soccer.com" class="Nav">Soccer.com</a></li>
<li><a href="http://www.fifa.com/" class="Nav">fifa.com</a></li>
<li><a href="http://www.ussoccer.com/" class="Nav">ussoccer.com</a></li>
</ul>
</li>
</ul>
</div>
<div id="main">
<p>Below you will find the most recent sports news, or you can use the main site navigation to go right the source!</p>
<h1>Top Sports News Stories</h1>
<div id="newsCell"></div>
</div>
<div id="footer">
<p>
<a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Strict" height="31" width="88" style="border: 0px;margin:0;" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img src="http://www.austincc.edu/jscholl/images/vcss.png" alt="Valid CSS!" height="31" width="88" style="border: 0px;margin:0;" /></a>
</p>
</div>
<!--these are your validation icons-->
</body>
</html>