Answer the question
In order to leave comments, you need to log in
How to pull c localstorage json using jquery and read?
How to read localstorage jsone key using jquery ?
There is a code:
function ref_cart() {
var output = "";
var allCnt = 0;
$(".cart li").remove();
for (var i = 0; i < localStorage.length; i++) {
output += "<li>ID: "+localStorage.key(i)+" | Количество: "+localStorage.getItem(localStorage.key(i))+" <button data-pr='"+localStorage.key(i)+"' class='remove'> X </button></li>";
allCnt = + parseInt(localStorage.getItem(localStorage.key(i))) + allCnt;
}
output += "<li>Общий метраж: " + allCnt + " метров</li>";
$(".cart").append(output);
}
ID: pr1 | Quantity: {"name":"coarse calico";"coutTX":600; "priceTX": 0.3}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question