[Solved]Java Script 1 Add Function Page1html Page2html Called Whenever Page Loaded Create Cookie S Q37175737
Java Script
1. Add a function to page1.html and page2.html that is calledwhenever the page is loaded. Create a cookie that stores how manytimes the user has loaded page1.html and page2.html separately. Youcould call the cookies page1HitCount and page2HitCount. Display thevalues on both pages using getCookieByName().
You can do Only one page as that would be enough to help me.
<!DOCTYPE html>
<html>
<head>
<title>Page 1</title>
</head>
<body>
<h1>This is page 1</h1>
<input type = “button” id=”page2″ value= “Go to page 2″onclick=”pageRedirect()”>
<script>
function pageRedirect() {
location.replace(“page2.html”);
——————————————————————————————————————————-
<!DOCTYPE html>
<html>
<head>
<title>Page 2</title>
</head>
<body>
<h1>This is page 2</h1>
<input type = “button” id=”page2″ value= “Go to page 1″onclick=”pageRedirect()”>
<script>
function pageRedirect() {
location.replace(“page1.html”);
}
</script>
</body>
</html>
Expert Answer
Answer to Java Script 1. Add a function to page1.html and page2.html that is called whenever the page is loaded. Create a cookie t… . . .
OR

