function tryJSON(app) { var url = '/cgi-bin/TryCGIApp.cgi'; var params = "mode=blackout"; new Ajax.Request(url, { onSuccess : function(resp,jsonheader) { var foo = jsonheader.boStatus; var funk = jsonheader.boError; alert("The response from the server is: " + foo + " and " + funk); }, onFailure : function(resp) { alert("Oops, there's been an error."); }, parameters : params }); }