+ 6

XMLHttp requests doesn’t work on the app

Works fine in the browser. Status is 200. But in the sololearn app readyState is 4 but status is 0. https://code.sololearn.com/W19t7vuq9RjP/?ref=app

4th Apr 2018, 10:50 PM
Toni Isotalo
Toni Isotalo - avatar
1 ответ
+ 2
I think that problem is in how SL app display web code. This dont load code on SL web but inject code in WebView and this cause problems in some contexts... Your code do an XHR request when it must follow security policy (same origin restriction in particular). With browser you run it in same origin (no security problem) but in android app, because code is not loaded from that adress but is injected, when you run it will be raised an security error (not same origin request)... This is my opinion, i am not sure
5th Apr 2018, 8:33 AM
KrOW
KrOW - avatar