Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to pass laravel route name to ajax request

var id= $("input[name=editId]").val();
$.ajax({
   type:'POST',
   enctype: 'multipart/form-data',
   url:"{{ route('updateArticle') }}" + '/' + id,
   data: formdata,
   contentType: false,
   processData: false,
   success:function(data){
        $('.alert-success').html(data.success).fadeIn('slow');
        $('.alert-success').delay(3000).fadeOut('slow');
   }
});
Comment

How to pass named route parameter with ajax Laravel

var id = $("input[name=editId]").val();
var url = "{{ route('updateArticle', ":id") }}";
url = url.replace(':id', id);

$.ajax({
   type:'POST',
   enctype: 'multipart/form-data',
   url: url,
   data: formdata,
   contentType: false,
   processData: false,
   success:function(data){
        $('.alert-success').html(data.success).fadeIn('slow');
        $('.alert-success').delay(3000).fadeOut('slow');
   }
});
Comment

how to pass named route ajax laravel

var id= $("input[name=editId]").val();
$.ajax({
   type:'POST',
   enctype: 'multipart/form-data',
   url:"{{ route('updateArticle',"id") }}",
   data: formdata,
   contentType: false,
   processData: false,
   success:function(data){
        $('.alert-success').html(data.success).fadeIn('slow');
        $('.alert-success').delay(3000).fadeOut('slow');
   }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to remove modal-backdrop fade in jquery 
Javascript :: vuejs v-for reverse 
Javascript :: react native hide stack navigator title 
Javascript :: mouseover angular 6 
Javascript :: upgrading node on mac 
Javascript :: javascript replace spaces with nbsp 
Javascript :: get select2 selected value 
Javascript :: jquery detect when a checkbox is checked 
Javascript :: jquery remove element by id 
Javascript :: copy text to clipboard javascript 
Javascript :: __WEBPACK_IMPORTED_MODULE_0_react___default.a.createContext is not a function 
Javascript :: synchronous ajax 
Javascript :: javascript remove negative numbers from array 
Javascript :: electron hide top bar 
Javascript :: remove a class from all elements javascript 
Javascript :: javascript array split chunk 
Javascript :: how to remove cors error from node app 
Javascript :: js math round up 
Javascript :: remove last char from string javascript 
Javascript :: Could not resolve dependency error peer react@"^16.8.0 || ^17.0.0" from @material-ui/core@4.12.4 
Javascript :: write to file js 
Javascript :: angular for loop key value 
Javascript :: jqiery call onclick in another element 
Javascript :: uuid generator pure javascript 
Javascript :: chart js title 
Javascript :: javascript preload images 
Javascript :: wait for time javascript 
Javascript :: listen prop change vuejs 
Javascript :: display none using jquery 
Javascript :: get user language js 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =