Skip to content Skip to sidebar Skip to footer

Js Script Works Only When Alert Is Present - Not An Ajax Call

An OnClick event calls the following datepicker function. If an alert is present then, it works fine. Otherwise, it does not show the calender as required. Is this a timing issu

Solution 1:

Possible the calender DOM hasn't finished rendering - adding an alert() blocks the page which gives it time to finish rendering. Use the equivalent of jquery.ready (http://docs.jquery.com/Events/ready#fn) to render the calender and then only show it (rather than rendering it) on the onclick event.

Solution 2:

I changed the onClick event to onMouseOver event, and it seems to work fine. Although, I am not comfortable using it, as it will fireoff this event often. Thanks for all the responses.

Post a Comment for "Js Script Works Only When Alert Is Present - Not An Ajax Call"