76
rated 0 times
[
78]
[
2]
/ answers: 1 / hits: 21226
/ 11 Years ago, sat, september 21, 2013, 12:00:00
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', 'ControllersAdminDashboardController@putUpdateSubmitScan');
My controller
public function putUpdateSubmitScan()
{
if (Request::ajax())
{
return Response::json(array('success' => 1, 'data' => test));
}
}
Any idea what went wrong?
More From » php