Tuesday, 15 June 2010

javascript - $.show not occuring before $.ajax call even though $.show is called first -



javascript - $.show not occuring before $.ajax call even though $.show is called first -

okay have onsubmit() bound click:

function onsubmit() { // grab image source var pictureurl = $('#preview_img').attr("src"); var modelnum; // hide containers $('#ajaxloading').show(); $('#send_cnt').hide(); $('#capture_cnt').hide(); // check see if doing ocr or manual input if (pictureurl !== '') { var imageserviceurl = serviceurl + 'ocr/getmodelnumber'; modelnum = getmodelnumber(pictureurl, imageserviceurl); } else { modelnum = $('#model_number_input').val().touppercase(); } if (modelnum) { getandshowlinks(modelnum); } }

in method can see showing ajax spinning wheel $('#ajaxloading').show(); , calling few functions downwards below. getmodelnumber has ajax phone call in getandshowlinks. however, when click on "send" button freezes , when ajax calls completed shows again. 1 of ajax calls synchronous other asynchronous.

any hints?

javascript jquery ajax intel-xdk

No comments:

Post a Comment