0

我正在尝试为我现在正在处理的一个项目找出本地缓存,虽然我已经成功地设置、填充和完成了大部分数据库方面的工作,但我的 javascript 似乎吓坏了我。

我制作了一个 jsfiddle ( http://jsfiddle.net/hW6RX/9/ ) 来说明我的意思。单击 Get info... 应该会弹出一个警报,然后从表中的 db 填充默认值,然后应该有第二个警报,在您清除它之后,它应该进行一些更改,然后将新的 db 值添加到桌子(最后应该有 10 个项目,bar 和 cantbelieve 只出现一次,而 foo 第二次变为 bur ......非常简单)。

但是,相反,两个弹出窗口都出现了,然后它只执行第一个 printValues()。功能和警报的位置似乎不会影响结果(因为所有功能都在尝试内,所有功能都在外面,我将它们分开......移动了警报...... w / e)所以我'我想我错过了什么,或者有某种时间问题。任何人都可以帮忙吗?

4

1 回答 1

0

Got it fixed, http://jsfiddle.net/hW6RX/14/ is working as intended (although I'd rather not make the user have to click for each part of the process... but that can be fixed later I guess).

If you click Initialize it will print out the first part, and then clicking test will print out the next part (it will clear everything when you initialize or you can clear with the clear link at any time)

于 2011-10-31T13:22:13.643 回答