开发者

What is causing this bug in HTML 5 local storage?

开发者 https://www.devze.com 2023-04-13 06:55 出处:网络
http://jsfiddle.net/y8Uju/25/ Over there is my fiddle and if you add stuff to the list sometimes and I mean sometimes when you refresh page bottom 1 i开发者_运维技巧tem disappears....why is this?You

http://jsfiddle.net/y8Uju/25/

Over there is my fiddle and if you add stuff to the list sometimes and I mean sometimes when you refresh page bottom 1 i开发者_运维技巧tem disappears....why is this?


You reuse the 'i' variable, without declaring in your bindName function. Therefor it skips every even item in the list. Just change

for (i = 0; i < inputNames.length; i++) {

into

for (var i = 0; i < inputNames.length; i++) {

PS. please post your code on StackOverflow, instead of just referring to a jsfiddle.

0

精彩评论

暂无评论...
验证码 换一张
取 消