문제

I'm trying to figure out local caching for a project I'm working on right now and while I've had success with setting up, populating and doing most of the db side, my javascript seems to be freaking out on me.

I've made a jsfiddle ( http://jsfiddle.net/hW6RX/9/ ) to show what I mean. Clicking on Get info... should pop up an alert, then populate the default values from the db in the table, then there should be a second alert and after you clear it it should preform a few changes then add the new db values to the table (there should be 10 items total at the end, with bar and cantbelieve only showing up once and foo changing to bur the second time... pretty simple).

But, instead both popups are coming up then it only does the first printValues(). the location of the functions and alerts doesn't seem to effect the outcome (as in all the functions were inside the try, all were outside, i split them up... moved the alerts... w/e) so I'm thinking I'm missing something, or there is some kind of timing issue. Can anyone help?

도움이 되었습니까?

해결책

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)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top