in Firefox, only on firefox it will pop up and give you a warning "This web page is being redirected to a new location. Would you like to send this form that you typed to a new location."
I don't have a form, I use javascript to extract values from a text field
I checked on firebug which says PUT / admin / submit-scan / 301 constantly moves PUT submit-scan 302 Found
My js
function submitGoods(){
var registeredNo = $('input[name=registeredno]').val();
var weight = $('input[name=weight]').val();
$.ajax({
type: 'PUT',
url: '/admin/submit-scan/',
data: {
registeredNo: registeredNo,
weight: weight,
_token: csrfToken
},
dataType: 'json'
}).done(function(data){
data = $.parseJSON(data);
});
}
My route
Route::put('submit-scan', 'Controllers\Admin\DashboardController@putUpdateSubmitScan');
My controller
public function putUpdateSubmitScan()
{
if (Request::ajax())
{
return Response::json(array('success' => 1, 'data' => "test"));
}
}
Any idea what went wrong?
source
share