Fix JS error
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
$(document).ready(function(){
|
||||
// include navbar
|
||||
$(".blog-insert").load("pages/blog.html", function(){
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// set page title
|
||||
window.page_title = "Computer Science Blog | Matthew Grove";
|
||||
|
||||
window.onload = function() {
|
||||
// set the current date
|
||||
var date = new Date();
|
||||
@@ -12,7 +11,12 @@ window.onload = function() {
|
||||
var current_date = day + "-" + (date.getMonth() + 1) + "-" + date.getFullYear();
|
||||
|
||||
// display date
|
||||
document.getElementById("current_date").innerHTML = current_date;
|
||||
$("#current_date").html(current_date);
|
||||
|
||||
// include navbar
|
||||
$(".blog-insert").load("pages/blog.html", function(){
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function nextPage() {
|
||||
|
||||
31
computer-science-blog/scripts/scripts.js~
Normal file
31
computer-science-blog/scripts/scripts.js~
Normal file
@@ -0,0 +1,31 @@
|
||||
// set page title
|
||||
window.page_title = "Computer Science Blog | Matthew Grove";
|
||||
|
||||
window.onload = function() {
|
||||
// set the current date
|
||||
var date = new Date();
|
||||
|
||||
// ternary operator: if the date < 10 then add 0 to the start of it, else display the date
|
||||
var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
|
||||
|
||||
// set current date
|
||||
var current_date = day + "-" + (date.getMonth() + 1) + "-" + date.getFullYear();
|
||||
|
||||
// display date
|
||||
document.getElementById("current_date").innerHTML = current_date;
|
||||
}
|
||||
|
||||
function nextPage() {
|
||||
displayPage(pages[0]);
|
||||
}
|
||||
|
||||
function previousPage() {
|
||||
|
||||
}
|
||||
|
||||
function displayPage(page) {
|
||||
document.getElementById("iframe").src = "pages/" + page + ".html";
|
||||
}
|
||||
|
||||
var pages = ["page_01", "page_02", "page_03"];
|
||||
var pageIndex = 0;
|
||||
Reference in New Issue
Block a user