Thanks for your reply.I reviewed the code and it was a structure problem, I've set a few things up differently and now it works. Thanks :)
On Mar 6, 10:01 am, James <james.gp....@gmail.com> wrote: > I don't see any issues with the code you posted. I suggest try > removing some code from inside-out to debug. Start by removing the > AJAX portion. Does it still follow through on the href? If not, it's > the AJAX. Is so, something else is wrong. Remove the confirm, and > test. Etc. > > On Mar 6, 2:56 am, bart <b...@ivwd.nl> wrote: > > > Hi all, > > > I'm running into some trouble using the jquery $.post function. I'm > > using it in my CMS to delete a page record and after the deletion to > > display the updated page with the just deleted page removed ofcourse. > > Needless to say AJAX comes in handy here because of the page refresh. > > > Here's my code; > > > $(document).ready(function(){ > > > $('p.editblock a.del').click(function() > > { > > var table_id = $(this).parent().parent().attr('id').split('_'); > > > if(confirm("Are you sure?")) > > { > > $.post('includes/inc/ajax/handledelete.php', { table: > > table_id[0], > > id: table_id[1] }, function(data) > > { > > $('#sitewrapper').html(data); > > }); > > } > > > return false; > > > }); > > }); > > > So the php file handles the delete query with the database and in the > > callback I'm replacing all the #sitewrapper html with the output of > > the php file. This does work, and the page does get displayed properly > > (with the deleted item removed) but after that the code stops working. > > > So if I'd want to delete another one it won't function, it doesn't > > even take the "false;" statement for the link instead of that it just > > follows the location of the href. If I do a refresh in the browser it > > works again but only for once to fall in the old pattern again... > > > Anyone who can help me with this?