Community
cancel
Showing results for 
Search instead for 
Did you mean: 
kulkarni__sameer
Beginner
100 Views

getjson is not working in app but working in testing.

I built app that retrieves data from server using getJSON() function, it is working in testing server and emulate but not working in app in real device.i am not getting what is problem .Please help me .it will helpful to me.

Tags (2)
0 Kudos
3 Replies
Diego_Calp
Valued Contributor I
100 Views

Hi, 
It would help if you post the code snippet with the getJSON call.

And, did you try the device debug option in XDK? It works very well with android devices, go to DEBUG XDK tab and connect your device with an USB cable.

Regards Diego

Chris_P_Intel
Employee
100 Views

It's probably whitelisting: https://software.intel.com/en-us/articles/cordova-whitelisting-with-intel-xdk-for-ajax-and-launching-external-apps

But it could also be a path problem. What is the path you are using for the .getJSON() call?  Any chance that the capitalization doesn't exactly match? Or are there spaces in the path or file name?

 

kulkarni__sameer
Beginner
100 Views

 I written fallowing code.

 var uid=$("#uid").val();
 var pass=$("#pass").val(); 
 $.getJSON('http://demo.6is.in/fcs1/fcs_login.php',{userid:uid,password:pass},function(data) {	
			      alert(data.info['user_id']); //uncomment this for debug
                if(data.status=='true')
                {   
                  $("#login_error").css("color","#000");
                  $("#login_error").text(""); 
			      $("#uid_hide").val(data.info['user_id']);
                  $("#name_hide").val(data.info['name']);
                  $("#place_hide").val(data.info['place']);
                  $("#image_hide").val(data.info['photo']);
                  $("#design_hide").val(data.info['design']);
                  $("#name_print").text(data.info['name']);
                  $("#login").addClass("hidden");
                  $("#home").removeClass("hidden");
                 }
                else
                {   
                   $("#login_error").css("color","red");
                   $("#login_error").text("Invalid Login");
                
                }
		    });

 

Reply