My main goal is basically to update the database without having to refresh the page.
Depends of how complex is your plan for the applications. Anyway to reduce amount of js code you could use a js library like jQuery or prototype etc. This way tasks like ajax are accomplished much faster (time to wrote the code)
Take a look at AJAX