javascript - Values from Servlet Shows Through direct link Browser But not through code -
i using jquery mobile. when use link in browser : http://**192/mlite/transferin2?imei=0000&username=usman&password=shafi, code shows accurate result servlet when pass values ajax , not alert(data), 1 thing make sure servlet recieving request , following ajax not showing values ajax.
...connection successful ginesh bro question is.. when put servlet in same localhost works..but when run other pc stops working in ajax,..but works through direct url please me..
$.ajax({ url : "http://19****/mlite/transferin2", type : "post", datatype : "json", data : { "username": amt, "password":imei2 }, success : function(data) { alert(data); }, error : function(xhr, ajaxoptions, thrownerror) { alert(xhr); //setmessage("#transferout-msg", "connection server failed"); //$("#transferout-msg").html(xhr.status + ":" + thrownerror); } });
use json.stringify data before post.
data: json.stringify({ "username": amt, "password":imei2 });
Comments
Post a Comment