Er Safari File Edit View History Bookmarks Develop Window Help …….. E 0 ADP Workfore... Onboarding Revature Sales froces

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Er Safari File Edit View History Bookmarks Develop Window Help …….. E 0 ADP Workfore... Onboarding Revature Sales froces

Post by answerhappygod »

Er Safari File Edit View History Bookmarks Develop Window Help E 0 Adp Workfore Onboarding Revature Sales Froces 1
Er Safari File Edit View History Bookmarks Develop Window Help E 0 Adp Workfore Onboarding Revature Sales Froces 1 (194.2 KiB) Viewed 26 times
cart.html
!DOCTYPE html>
<html>
<head>
<title> GalaxyStore</title>
</head>
<body>
<h1>GalaxyStore</h1>
<span id="cartSpan">GalaxyStoreCart..</span>
<br>
<button id="loadCartButton">loadCartButton</button>
<br>
<input id="cartInput">
<button id="saveCartButton">save Cart</button>
<script src="cart.js"></script>
</body>
</html>
cart.js
let cartSpan = document.getElementById("cartSpan");
let loadCartButton = document.getElementById("loadCartButton");
let cartInput = document.getElementById("cartInput");
let saveCartButton = document.getElementById("saveCartButton");
function saveCart() {
let httpRequest = new XMLHttpRequest();
let cartId = cartInput.value;
httpRequest.onreadystatechange = recieveData;
httpRequest.open("POST", "https://mohdscart.azurewebsites.net/");
httpRequest.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
httpRequest.send(JSON.stringify({ "name": cartName }));
console.log(JSON.stringify({ "name": cartName }));
function recieveData() {
if (httpRequest.readyState == 4) {
if (httpRequest.ready.status == 200) {
refreshList();
}
}
}
}
function refreshList() {
let httpRequest = new XMLHttpRequest();
httpRequest.onreadystatechange = recieveData;
httpRequest.open("GET", "https://mohdscart.azurewebsites.net/");
httpRequest.send();
function recieveData() {
if (httpRequest.readyState == 4) {
if (httpRequest.status == 200) {
let HTTPresponse = httpRequest.responseText;
let responseJSON = JSON.parse(HTTPresponse);
let cartList = document.createElement('ul');
cartSpan.innerHTML = "";
for (let i = 0; i < responseJson.length; i++) {
console.log(responseJson(i));
let cartSpanItem = document.createElement('li')
cartSpanItem.innerText = responseJson.id;
cartSpanList.appendChild(CatListItem)
}
cartSpan.appendChild(cartList);
}
}
}
}
saveCartButton.onclick = saveCart;
loadCartButton.onclick = refreshList;
Er Safari File Edit View History Bookmarks Develop Window Help …….. E 0 ADP Workfore... Onboarding Revature Sales froces Basic UNIX commands Basic UNIX commands + 1 Ba 2 R A GalaxyStore GalaxyStoreCart.. loadCartButton 55 XID ▾ Breakpoints @ Debugger Statements Ex All Exceptions Ex Uncaught Exceptions A Assertion Failures + ➡112 1 2 Filter save Cart Elements By Type By Path Cart.html -127.0.0.1 cart.js Line 12:56 Can't find variable: cartName Line 12:56 Can't find variable: cartName 400- All + ه الله R [3] Console 5 6 3 R 10 11 13 14 15 18 17 18 20 21 22 23 <>Cart.html) cart.js let cartSpan = document.getElementById("cartSpan"); 2 let loadCartButton = document.getElementById("loadCartButton"); s let cartInput = document.getElementById"cartInput"); Let saveCartButton = document.getElementById("saveCartButton"); 30 31 32 33 34 35 37 38 39 40 } TS function saveCart() { welcome-and-rules Sources } httpRequest.open("POST", } let httpRequest = new XMLHttpRequest(); let cartId = cartInput.value; httpRegvest oneradysge= recieveData; 127.0.0.1:5500/Cart.html Ted - Foundati...oject | Trello 968 € a } 25 26 function refreshList() { 27 let httpRequest 26 29 Network if (httpRequest.readyState = 4) { if (httpRequest.ready.status == 200) { refreshList(); function recieveData() ( httpRequest.setRequestHeader("Content-Type", "application/json; charset=UTF-8"); httpRequest.send(JSON.stringify({ "name": cartName}}); console.log(JSON.stringify({ "name": cartName}}}; function recieveData() ( R Timelines new XMLHttpRequest(); httpRequest.onreadystatechange = recieveData; "https://mohdscart.azurewebsites.net/"); if (httpRequest.readyState = 4) { if (httpRequest.status 200) { httpRequest.open("GET", "https://nohdscart.azurewebsites.net/"); httpRequest.send(); 8 Storage Let HTTPresponse = httpRequest. responseText; let responseJSON = JSON.parse(HTTPresponse); let cartList = document.createElement("ul'}; cartSpan.innerHTML = ""; - Patrick Faunaject | Trello RevaturePro - Dashboard a R · #tv MÅ Ć ((~)) x Graphics CJ ♥ Layers 31 M My Account Macy's +88 1 GalaxyS... Audit a ☺ 通花园口 Can't find variable: cartName D O Wed Jun 29 9:40 PM 2: JavaScript Debug Terr VSCode.ShipIt/* UTF-8 LF html Port: 5 Show All X
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply