You've got a scope issue with ```e``` .. e from deletepost is being replace by e from altertify.
```e.preventDefault()``` is just there to prevent the default action when clicking on the link (i.e navigating to a new page) so you can move this out side the alertify function entirely.