i have a Json result that i got through a webservice, now i want to see if it works, how do i make that Json values show in a button or link? and on page load?
one of the values returned looks like this : "name": "Muhammad Ali", "nickname": "The Greatest",
very new to json and javcascript.
Javascript and json :
function Getdata() {
$.ajax({
type: "POST",
data: "{}",
url: "https://raw.github.com/appcelerator/Documentation-Examples/master/HTTPClient/data/json.txt",
contentType: "application/json; cherset=utf-8",
datatype: "json",
success: loadpage,
failure: givealert
});
function loadpage(result) {
if (resu.hasOwnProperty("d")) { result = res.d; }
var data = JQuery.parseJSON(result);
}
function givealert(error) {
alert('failed!!' + error);
}
}
now how do i get it to show one value from the web-service in a label and on form load? html markup for the label/button :
<div id="listheight">
<a type="button" id="routing" href="#datatapage"></a>
</div>
i am using cordova/phonegap,Visual studi2010, html, javascript, css, jquerymobile and jquery1.8.2.
thanks in advance!