I'm creating an app with Phonegap and I do not know how to send a string from my .js to a web service that I have created with Java, some suggestions I'm new to this and I do not find anything clear, thanks. My JSON function is as follows
myfuncion: function() {
var x = document.getElementById("login").value;
document.getElementById("demo").innerHTML = x;
}
I could do a post with Ajax from here like this:
$.ajax({
type: "POST",
url: "http://localhost:8080/HelloSpringMVC/hello",
data: {x} ,
)};
I do not understand if you can use $ .ajax like this and pass the variable x.