php - Update Postgres database without reloading page -
i'm building personal reddit fun , experience (i'm pretty new whole thing).
on other web things i've made changes must applied same page, used form, action point current page. in php, have function check post variables form, make database query before page loads. way, when function later on called display data, have new stuff added.
this has worked tremendously , happens instantaneously because sites exclusively deployed local networks. came on own (i realize may not totally efficient). before, have go different page process button.
on current project, when click voting button, same thing happens , works fine. however, page longer i've made previously, , result, jumps top of page. it's jarring experience. i'd keep inline, nothing happened.
what kinds of tricks require little (read: simple) no server modification can use?
to make href stop reloading page add hrefs:
<a href="#" onclick="return false">blah</a> if using buttons pass post data forms php, same onclick trick wil work. suggest take quick google "jquery ajax"
Comments
Post a Comment