function checkError(json) { if(json.error) alert('Error: ' + json.error) }