Skip to content

Commit bf67050

Browse files
committed
fix missing JS
1 parent f578e73 commit bf67050

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/bootstraplesson.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
/*******************************************
22
* IDENTIFY OLD VERSIONS
33
*******************************************/
4+
function UrlExists(url) {
5+
var http = new XMLHttpRequest();
6+
http.open('HEAD', url, false); // TODO: change this to 'true' and use a promise to render the out of date banner
7+
http.send();
8+
return (http.status !== 404)
9+
}
410

511
function isNewest() {
612
try{
@@ -13,7 +19,7 @@
1319
: release.replace(/\/fall\d{4}/, "/spring" + (url_year+1));
1420

1521
// If that version exists, throw up a warning
16-
if(UrlExists(release)){
22+
if(UrlExists(next_release)){
1723
var outOfDate = document.createElement('div');
1824
outOfDate.setAttribute('id', 'outOfDate');
1925
outOfDate.innerHTML = 'These materials are OUT OF DATE! To get the latest version'

0 commit comments

Comments
 (0)