I'm creating an app with Phonegap and I don't know how to send a string from my .js to a web service that I have created with Java, any suggestions I'm new to this and I can't find anything clear, thanks. My JSON function is the following
myfuncion: function() {
var x = document.getElementById("login").value;
document.getElementById("demo").innerHTML = x;
}
I could make a post with Ajax from here like so:
$.ajax({
type: "POST",
url: "http://localhost:8080/HelloSpringMVC/hello",
data: {x} ,
)};
I don't understand if you can use $.ajax like this and pass the variable x.
First : I made a small change in the function myfunction so that it returns the value of x.
I hope it helps you.