Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I'm getting script.js:2 Uncaught ReferenceError: $ is not defined i;m stuck // Set the date at the top of the page $(#currentDay).currentTime(moment().format(dddd, MMMM Do)); //

I'm getting "script.js:2 Uncaught ReferenceError: $ is not defined" i;m stuck

// Set the date at the top of the page

$("#currentDay").currentTime(moment().format("dddd, MMMM Do"));

// Set the status of each time-block

$(".time-block").each(function() {

var currentTime = moment().hours();

var timeBlock = parseInt($(this).attr("id").split("-")[1]);

if (timeBlock < currentTime) {

$(this).addClass("past");

} else if (timeBlock === currentTime) {

$(this).addClass("present");

} else {

$(this).addClass("future");

}

});

// Load any saved data from localStorage

$(".description").each(function() {

var timeBlock = $(this).parent().attr("id");

var savedData = localStorage.getItem(timeBlock);

if (savedData) {

$(this).val(savedData);

}

});

// Save the data to localStorage on click

$(".saveBtn").on("click", function() {

var timeBlock = $(this).parent().attr("id");

var description = $(this).siblings(".description").val();

localStorage.setItem(timeBlock, description);

});

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions