on Firefox, only on firefox it will popup and give you a warning "This web page is being redirected to a new location. Would you like to resend the for form you have typed to the new location."
I got no form , i use javascript to extract values from textbox
I checked on firebug it says PUT /admin/submit-scan/ 301 moved permanently 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?