Question: Session storage and local storage not saving html javascript PROBLEM THE DATA IS COMING UP BLANK IN BOTH THE DEVELOPMENT TOOLS AND I+WHEN WEBPAGE IS

Session storage and local storage not saving html javascript

PROBLEM THE DATA IS COMING UP BLANK IN BOTH THE DEVELOPMENT TOOLS AND I+WHEN WEBPAGE IS REFRESHED THE SESSION DATA IS GONE

Here is the html code:

var HTML = "biology.html";

localStorage.setItem("biology.html", HTML);

Enter Question 1:

Next, add a correct answer and several incorrect answers for your question.

function PreviewImage1() {

var oFReader = new FileReader();

oFReader.readAsDataURL(document.getElementById("uploadImage1").files[0]);

oFReader.onload = function (oFREvent) {

document.getElementById("uploadPreview1").src = oFREvent.target.result;

};

};

Enter Question 2:

Next, add a correct answer and several incorrect answers for your question.

Session storage and local storage not saving html javascript PROBLEM THE DATA

function PreviewImage2() {

var oFReader = new FileReader();

oFReader.readAsDataURL(document.getElementById("uploadImage2").files[0]);

oFReader.onload = function (oFREvent) {

document.getElementById("uploadPreview2").src = oFREvent.target.result;

};

};

Enter Question 3:

Next, add a correct answer and several incorrect answers for your question.

function PreviewImage3() {

var oFReader = new FileReader();

oFReader.readAsDataURL(document.getElementById("uploadImage3").files[0]);

oFReader.onload = function (oFREvent) {

document.getElementById("uploadPreview3").src = oFREvent.target.result;

};

};

Enter Question 4:

Next, add a correct answer and several incorrect answers for your question.

IS COMING UP BLANK IN BOTH THE DEVELOPMENT TOOLS AND I+WHEN WEBPAGE

function PreviewImage4() {

var oFReader = new FileReader();

oFReader.readAsDataURL(document.getElementById("uploadImage4").files[0]);

oFReader.onload = function (oFREvent) {

document.getElementById("uploadPreview4").src = oFREvent.target.result;

};

};

Enter Question 5:

Next, add a correct answer and several incorrect answers for your question.

function PreviewImage5() {

var oFReader = new FileReader();

oFReader.readAsDataURL(document.getElementById("uploadImage5").files[0]);

oFReader.onload = function (oFREvent) {

document.getElementById("uploadPreview5").src = oFREvent.target.result;

};

};

Enter Question 6:

Next, add a correct answer and several incorrect answers for your question.

IS REFRESHED THE SESSION DATA IS GONE Here is the html code:

function PreviewImage9() {

var oFReader = new FileReader();

oFReader.readAsDataURL(document.getElementById("uploadImage6").files[0]);

oFReader.onload = function (oFREvent) {

document.getElementById("uploadPreview6").src = oFREvent.target.result;

};

};

Enter Question 7:

Next, add a correct answer and several incorrect answers for your question.

function PreviewImage7() {

var oFReader = new FileReader();

oFReader.readAsDataURL(document.getElementById("uploadImage7").files[0]);

oFReader.onload = function (oFREvent) {

document.getElementById("uploadPreview7").src = oFREvent.target.result;

};

};

Enter Question 8:

Next, add a correct answer and several incorrect answers for your question.

var HTML = "biology.html"; localStorage.setItem("biology.html", HTML); Chemistry Physics Math Technology Environmental Science

function PreviewImage9() {

var oFReader = new FileReader();

oFReader.readAsDataURL(document.getElementById("uploadImage8").files[0]);

oFReader.onload = function (oFREvent) {

document.getElementById("uploadPreview8").src = oFREvent.target.result;

};

};

Enter Question 9:

Next, add a correct answer and several incorrect answers for your question.

function PreviewImage9() {

var oFReader = new FileReader();

oFReader.readAsDataURL(document.getElementById("uploadImage9").files[0]);

oFReader.onload = function (oFREvent) {

document.getElementById("uploadPreview9").src = oFREvent.target.result;

};

};

Enter Question 10:

Next, add a correct answer and several incorrect answers for your question.

Enter Question 1: Next, add a correct answer and several incorrect answers

function PreviewImage10() {

var oFReader = new FileReader();

oFReader.readAsDataURL(document.getElementById("uploadImage10").files[0]);

oFReader.onload = function (oFREvent) {

document.getElementById("uploadPreview10").src = oFREvent.target.result;

};

};

Enter Question 11:

Next, add a correct answer and several incorrect answers for your question.

function PreviewImage11() {

var oFReader = new FileReader();

oFReader.readAsDataURL(document.getElementById("uploadImage11").files[0]);

oFReader.onload = function (oFREvent) {

document.getElementById("uploadPreview11").src = oFREvent.target.result;

};

};

Enter Question 12:

Next, add a correct answer and several incorrect answers for your question.

for your question. function PreviewImage1() { var oFReader = new FileReader(); oFReader.readAsDataURL(document.getElementById("uploadImage1").files[0]);

function PreviewImage12() {

var oFReader = new FileReader();

oFReader.readAsDataURL(document.getElementById("uploadImage12").files[0]);

oFReader.onload = function (oFREvent) {

document.getElementById("uploadPreview12").src = oFREvent.target.result;

};

};

Enter Question 13:

Next, add a correct answer and several incorrect answers for your question.

function PreviewImage13() {

var oFReader = new FileReader();

oFReader.readAsDataURL(document.getElementById("uploadImage13").files[0]);

oFReader.onload = function (oFREvent) {

document.getElementById("uploadPreview13").src = oFREvent.target.result;

};

};

Enter Question 14:

Next, add a correct answer and several incorrect answers for your question.

oFReader.onload = function (oFREvent) { document.getElementById("uploadPreview1").src = oFREvent.target.result; }; }; Enter Question

function PreviewImage14() {

var oFReader = new FileReader();

oFReader.readAsDataURL(document.getElementById("uploadImage14").files[0]);

oFReader.onload = function (oFREvent) {

document.getElementById("uploadPreview14").src = oFREvent.target.result;

};

};

Enter Question 15:

Next, add a correct answer and several incorrect answers for your question.

function PreviewImage15() {

var oFReader = new FileReader();

oFReader.readAsDataURL(document.getElementById("uploadImage15").files[0]);

oFReader.onload = function (oFREvent) {

document.getElementById("uploadPreview15").src = oFREvent.target.result;

};

};

Enter Question 16:

Next, add a correct answer and several incorrect answers for your question.

2: Next, add a correct answer and several incorrect answers for your

function postQuestion() {

var obj = {

question: document.getElementById("question15").value,

choice62: document.getElementById("choice58").value,

choice63: document.getElementById("choice59").value,

choice64: document.getElementById("choice60").value,

choice65: document.getElementById("choice61").value,

question: document.getElementById("question16").value,

choice62: document.getElementById("choice62").value,

choice63: document.getElementById("choice63").value,

choice64: document.getElementById("choice64").value,

choice65: document.getElementById("choice65").value

}

try {

sessionStorage.setItem("data", JSON.stringify(obj));

} catch (error) {

alert("Enable Session storage");

}

return false;

}

function PreviewImage16() {

var oFReader = new FileReader();

oFReader.readAsDataURL(document.getElementById("uploadImage16").files[0]);

oFReader.onload = function (oFREvent) {

document.getElementById("uploadPreview16").src = oFREvent.target.result;

sessionStorage.setItem("image", oFREvent.target.result);

};

};

body {

font-family: Arial, Helvetica, sans-serif;

font-size: 20px;

}

#myBtn {

display: none;

position: fixed;

bottom: 20px;

right: 30px;

z-index: 99;

font-size: 18px;

border: none;

outline: none;

background-color: red;

color: white;

cursor: pointer;

padding: 15px;

border-radius: 4px;

}

#myBtn:hover {

background-color: #555;

}

// When the user scrolls down 20px from the top of the document, show the button

window.onscroll = function() {scrollFunction()};

function scrollFunction() {

if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {

document.getElementById("myBtn").style.display = "block";

} else {

document.getElementById("myBtn").style.display = "none";

}

}

// When the user clicks on the button, scroll to the top of the document

function topFunction() {

document.body.scrollTop = 0;

document.documentElement.scrollTop = 0;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!