Closed khjung29 closed 3 years ago
@khjung29 This issue doesn't relate to the plugin. You enquire the same in jQuery forum.
We encounter the same in one of our Cordova apps.
This IMHO is not a question about how to use the jQuery API. What the author does, is a correct way to send sync requests. However, the success handler is not called synchronously as expected, but asynchronously. As a consequence, any sync jQuery.ajax() does not deliver a result.
AFAIK, jQuery's implementation relies on the readystatechange
event. Is there anything special (non-standard) with respect to the readystatechange
event in the cordova-plugin-wkwebview-file-xhr?
I didn't dive too much into it, but looking at the polyfill's implementation, I think its XMLHttpRequest.prototype.send
method cannot deliver the readystatechange
events synchronously, because its implementation is promise based (using getHandler()
).
Hi, I am also faced same issue. Is there any solution??? Thanks.
jQuery.ajax({ url: strUrl, success: function(html) { strReturn = html; }, async:false });
async: false not working...