I'm essentially building a personal reddit for fun and experience (I'm pretty new to this whole thing).
On other web things I've made where changes must be applied to the same page, I used a form, where the action would point to the current page. In PHP, I would have a function that would check for the POST variables from that form, then make the database query before the page loads. This way, when the function later on is called to display the data, it would have the new stuff added.
This has worked tremendously well and happens instantaneously because my sites are exclusively deployed to local networks. I came up with it on my own (I realize it may not be totally efficient). Before, I would have it go to a different page to process with a back button.
On my current project, when I click a voting button, the same thing happens and it works fine. However, this page is much longer than anything I've made previously, and as a result, it jumps to the top of the page. It's a jarring experience. I'd like to keep everything inline, like nothing happened.
What kinds of tricks that require little (read: simple) to no server modification can I use?