Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
17 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
Highlighted
Valued Contributor I
17 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

0 Kudos
Highlighted
Employee
17 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?

 

0 Kudos
Highlighted
17 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");
                
                }
		    });

 

0 Kudos