Created
August 8, 2015 18:04
-
-
Save javawolfpack/df97c4fc770e643d7adc to your computer and use it in GitHub Desktop.
Gist of AJAX test code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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