php - Cordova WhiteList does not allow access to my Server -
i can not connect database because url rejected. url want access this:
i have urls same structure, , have tried in config.xml file did not worked.
<access origin="*" /> <access origin="http://192.168.0.16" subdomains="true" />
or
<access origin="http://192.168.0.16/*"/>
this complete code create path , call functions connect database:
function pulluser(username,apodo,secondname,lastname,pass1,usermail){ var method='get'; var url = appconstants.requestpulluserurl(); //alert('cogidaurl: '+ url); var path = url + "?nombre="+username+"&apodo="+apodo+"&apellido1="+secondname+ "&apellido2="+lastname+"&email="+usermail+"&clave="+pass1; console.log(path); //alert('el path es: '+ path); var xhr = new xmlhttprequest(); xhr.onreadystatechange = function(){ //alert('onready. readystate:'+xhr.readystate+' status: '+xhr.status); if(xhr.readystate == 4 && xhr.status == 200){ resp = xhr.responsetext; //alert('registro completado'); transitionlog(); }else{ //alert('devuelve false'); return false; } } xhr.open(method, path, true); //creamos la peticion resp = xhr.send(); // falla aqui sin server alert('despues del send'); }
thanks.
i solved it, adding whitelist pluggin. don´t know why when created project did not added itself. bash code on app directory solved it: cordova plugin add https://github.com/apache/cordova-plugin-whitelist.git
Comments
Post a Comment