javascript - how to make an ajax call from cordova (it tried to load a file as far as I can see) -


i need make ajax call:

call_server("192.168.1.102/proj04/get_all_food?extent=....", "get"...). 

(this higher order function btw; worked before browser. ofcourse, didnt have 192.168.1.102 there cause local machine)

the answer comes back:

failed load resource: server responded status of 404 (not found)    file:///android_asset/www/192.168.1.102/proj04/get_all_food?extent=dessert 

it tried load file can tell. also, url totally wrong.

what correct way this?

thanks in advance.

you lost protocol, ajax auto current path is: file:///android_asset/www/ + url

call_server("http://192.168.1.102/proj04/get_all_food?extent=....", "get"...) 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -