-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XHR load local file synchronization #78
Comments
@taxuangiao No such issue exists as reported by you. Plugin works fine for synchronous request as well. |
@manish2788 Thanks. However, I retry with synchronous XHR request and It is not OK. But I update to asynchronous XHR request, I could load file content. So please check again. |
@taxuangiao Can you please share a sample cordova app demonstrating the issue you are facing. |
@manish2788 there are source code to load file |
@taxuangiao Please go through https://javascript.info/xmlhttprequest to understand how to create an XMLHttpRequest request and get a response. No issue with the plugin. |
@manish2788 , with above code, I tried remove this plugin and build on cordova-ios@4 (UIWebView) and it is OK. I think the plugin not support synchronous XHR request. |
On the ios side the http request, response is synchronous but the
communication with the plugin is asyc. The client registers a callback
handler. At the time this was originally development, Js es6 await/async
was not an option. It might be possible now for the send to return a
promise and the client could call await xhr.send(). Kind of a JS impl
restriction.
…On Thu, Jan 21, 2021, 3:26 AM Manish Kumar ***@***.***> wrote:
@taxuangiao <https://github.com/taxuangiao> Please go through
https://javascript.info/xmlhttprequest to understand how to create an
XMLHttpRequest request and get a response. No issue with the plugin.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#78 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEGCGU3YLX4DDPJM42KEI7TS276LVANCNFSM4WHGEROA>
.
|
Dear @ALL,
At this moment, when use this plugin, I cannot load local file via XHR synchronization as below:
xhttp.open("GET", filePath, false); xhttp.send(null); var text = xhttp.responseText;
Is this issue?
Thank you so much.
The text was updated successfully, but these errors were encountered: