I have a button which calls a modal box to fade into the screen saying a value posted from the button then fade off, this works fine using jquery, but I also want on the sam
You have an error in your ajax definitions. It should be:
$.ajax ({ url: 'reserbook.php', data: "book_id="+book_id, type: 'post', success: function() { $('.modal-box').text(result).fadeIn(700, function() { setTimeout(function() { $('.modal-box').fadeOut(); }, 2000); }); } });