I have two pages:
- choose.html
- create.html
In the choose.html I can choose an entry from a listview. I can click on such entries in the listview and I want to pass the ID of that entry so that I can use the ID on the html page create.html.
ID is a number.
I have done:
When I clicked on an entry, I get the ID:
function postID(id) {
alert(id);
}
This functions so far.
Then I tried this code with a GET on the create.html:
POST:
function postID(id) {
$.ajax({
url: "create.html",
type: "POST",
dataType: "text",
data: id,
success: function () {
document.location.href = "create.html";
},
error: function (jqXhr) {
alert("Error");
}
});
}
GET:
try {
$.get("chooseAddress.html", function (id) {
alert(id);
});
}
catch (e) {
alert();
}
But nothing happens. Can you help me?
Thanks