remove row from table with XMLHttpRequest()
$(document).ready(function(){
// Delete
$('.delete').click(function(){
var el = this;
var id = this.id;
var splitid = id.split("_");
// Delete id
var deleteid = splitid[1];
// AJAX Request
$.ajax({
url: 'remove.php',
type: 'POST',
data: { id:deleteid },
success: function(response){
if(response == 1){
// Remove row from HTML Table
$(el).closest('tr').css('background','tomato');
$(el).closest('tr').fadeOut(800,function(){
$(this).remove();
});
}else{
alert('Invalid ID.');
}
}
});
});
});
Also in JavaScript:
- jquery get table to object
- react native create button
- js string times
- div gets pulled to corner when resizing
- nodejs format text
- Hide elements until Alpine Js loads
- how many stacks are required for evaluation of prefix expression
- node js check type of variable
- mv multiple directories
- clear timeout js
- classic asp json multidemsion json
- queryselector javascript varias clases
- for loop inside a for loop javascript
- js create jaon object from for loop
- what is an iterator in javascript
- set timer
- js data object length
- get random numbers javascript
- killall node windows
- mdn error 404
- jQuery check a radio button
- hello world in jsp
- jquery open page in new tab
- To do validation for the textbox , radio button and dropdown using jquery