Posle izvršenja ovog koda preko koga pozivam .php script za insert podataka u bazu:
Code:
<script type="text/javascript">
$(document).ready(function() {
$('#myForm').ajaxForm({
target: '#showdata',
success: function() {
$('#showdata').fadeIn('slow');
}
});
});
</script>
<script type="text/javascript">
$(document).ready(function() {
$('#myForm').ajaxForm({
target: '#showdata',
success: function() {
$('#showdata').fadeIn('slow');
}
});
});
</script>
Sledeći kod koji služi za brisanje rekorda iz baze ni da mrdne.
Code:
<script type="text/javascript">
$(document).ready(function()
{
$('table#delTable td a.delete').click(function()
{
if (confirm("Are you sure you want to delete this row?"))
{
var id = $(this).parent().parent().attr('id');
var data = 'id=' + id ;
var parent = $(this).parent().parent();
$.ajax(
{
type: "POST",
url: "delete_row.php",
data: data,
cache: false,
success: function()
{
parent.fadeOut('slow', function() {$(this).remove();});
}
});
}
});
// style the table with alternate colors
// sets specified color for every odd row
$('table#delTable tr:odd').css('background',' #FFFFFF');
});
</script>
<script type="text/javascript">
$(document).ready(function()
{
$('table#delTable td a.delete').click(function()
{
if (confirm("Are you sure you want to delete this row?"))
{
var id = $(this).parent().parent().attr('id');
var data = 'id=' + id ;
var parent = $(this).parent().parent();
$.ajax(
{
type: "POST",
url: "delete_row.php",
data: data,
cache: false,
success: function()
{
parent.fadeOut('slow', function() {$(this).remove();});
}
});
}
});
// style the table with alternate colors
// sets specified color for every odd row
$('table#delTable tr:odd').css('background',' #FFFFFF');
});
</script>
Pre insertovanja podataka, izvršenja prvog skripta, sve radi normalno. Da li je problem sa nekim refresh-ovanjem DOM-a ili nešto slično.
Hvala unapred na pomoći.