How to prevent page from refreshing after ajax submit

I just started using Ajax function in my work and I’m not very familiar with it. I have this problem that when I submit data, it submits without refreshing the page, but on a second time when trying to submit, the page refreshes before submitting. I’ve used the e.preventDefault() to prevent the page from refreshing but it is not working for me. It just seems there is something I’m not doing right.