OK Katya,
I had deleted the code,
the code has been re added.
to define "totalprice" what do I add?
as regards the code you suggested yesterday
if($this.attr("idx").slice(1))){
...
var index = parseInt($this.attr("idx").slice(1));
....
}
is the what you mean
codevar mainorderArray;
try {
mainorderArray = JSON.parse(localStorage.getItem("mainorderArray"));
if ({}.toString.call(mainorderArray) !== "[object Array]") {
mainorderArray = [];
}
} catch ( e ) {
mainorderArray = [];
}
var $this = $(this);
if($this.attr("idx").slice(1)))
var index = parseInt($this.attr("idx").slice(1));
if (index >=0 && index < mainorderArray.length) {
mainorderArray.splice(index, 1);
}
localStorage.setItem("mainorderArray", JSON.stringify(mainorderArray));
/code
thx