I have a javascript/jquery code http://jsfiddle.net/9773D/ for timer.
I am trying to port it to jQuery Mobile code but I am confused about the pageinit,bind,live etc window events.
In the code i see that the error is because some elements in the tick() function are not loaded in DOM before it has been invoked in the code. Can someone help me in correcting my code.
Thanks,
I changed your line to
var timeDisplay = $(".time")[0];and that fixes it.
Edit:
Adding explanation:
Since you used innerHTML instead of
$('.time').html(""), you needed to set timeDisplay to the HTML node, sinceinnerHTMLis a property of the node, not the jQuery object that is returned by the selector$('.time').