I made a mobile app using phonegap. I use Ajax to fetch data from a server. On the server there is a webservice made in Laravel, which returns the data in json. This is the code:
jQuery(function($) {
$(document).ready(function() {
$(".loader").show();
$.ajax({
url: 'http://miIp/public/menu',
dataType: 'json',
success:function(data){
$("#conectionError").hide();
if(data == 1){
$('#liveStreaming').show();
$("#live_choose").show();
$(".btn_menu").hide();
}
if(data == 0){
$('#liveStreaming').hide();
$("#live_choose").hide();
$(".btn_menu").show();
$('#liveStreaming').hide();
}
$(".loader").fadeOut("slow");
},
error:function(){
$(".loader").hide();
var divHeight = $("#conectionError").height();
var imgHeight = $("#conectionErrorImg").height();
var imgMargin = (divHeight - imgHeight)/2;
$("#conectionErrorImg").css("margin-top", imgMargin);
$("#conectionError").show();
},
async: true
});
});
});
I tried the application locally. The laravel application had it in xampp, and it worked perfectly. I even compile the app with phonegapp, I installed it, and it worked perfectly.
Today I uploaded the laravel app to a cloud server in WIROOS, and the app does not bring anything. I paste the links in the browser and it brings me the data correctly, but ajax always goes through the error, it never connects.
I assumed that maybe it is some problem of permissions (I am using Vesta Panel), but I can not understand what happens.
Does anyone have any ideas?