Created
October 29, 2015 21:07
-
-
Save codepainkiller/9bf374f5363131bce5f4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$.ajax({ | |
url: 'http://mydomain.com/ajax-request', | |
type: 'POST', | |
dataType: 'json', | |
async: true, | |
data:{ | |
'_token': '{{ csrf_token() }}', | |
'foo' : 'Foo' | |
}, | |
success: function success(data, status) { | |
console.log(data); | |
alert(data); | |
}, | |
error: function error(xhr, textStatus, errorThrown) { | |
alert('Remote sever unavailable. Please try later'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment