Skip to content

Instantly share code, notes, and snippets.

@javawolfpack
Created August 8, 2015 18:04
Show Gist options
  • Save javawolfpack/df97c4fc770e643d7adc to your computer and use it in GitHub Desktop.
Save javawolfpack/df97c4fc770e643d7adc to your computer and use it in GitHub Desktop.
Gist of AJAX test code
<script>
new Ajax.Request('/test2', {
method:'get',
onSuccess: function(transport) {
var response = transport.responseText || "no response text";
//alert("Success! \n\n" + response);
$('content').replace(response)
new Ajax.Request('/test3', {
method:'get',
onSuccess: function(transport) {
var response2 = transport.responseText || "no response text";
//alert("Success! \n\n" + response);
$('content').replace(response2)
},
onFailure: function() { alert('Something went wrong...'); }
});
},
onFailure: function() { alert('Something went wrong...'); }
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment