So I'm new to AJAX and I was trying this code
<form role="form" id="ff" method="POST">
<div class="form-group">
<div class="short"><input type="text" class="form-control" id="exampleInputURL" placeholder="Paste a long URL..."></div>
</div>
<button type="submit" class="btn btn-primary btn-lg btn-block">Shorten</button>
</form>
<script>
$(document).ready(function() {
$('#ff').ajaxForm({url: 'short', type: 'post'}, function() {
alert("Thank you for your comment!");
});
});
</script>
But it doesn't seem to be working, I'm getting this error MethodNotAllowedHttpException
On my routes.php I have
Route::post('short', 'HomeController@ShortUrl');