I'm trying to polish my web programming skills with the unobtrusive yet extremely helpful polish I find on many sites. Stackoverflow.com, for one. When I ask a question, the page submits the question, and my browser reloads itself displaying my question. My back button works like it really should, not asking me (from a user's perspective) the scary question of "In order to display this page we need to resend your request to the server. Do you want to do that?"
In addition, after submitting the question, if I hit "refresh" it also doesn't call another form submit.
Is there a site that lists out tricks like this? I'm assuming that I'm going to have to rethink the standard display/submit/display cycle that I use most often, but I'm very willing to learn some new techniques.
Anyone have any pointers for me?
EDIT: I figured I'd say this here instead of in individual comments. Firebug is indeed a fantastic tool, and I use it all the time. I'm using jQuery more and more these days, but I'd hardly call myself proficient at it. I'd love to use Firebug to track what happens when asking questions, commenting, etc, but I don't want to abuse the site for the purposes of learning. ;)
Be a lifelong learner The best advice I ever received was to be a lifelong learner — no matter what stage you are in your career. It's estimated that the average shelf-life of a skill is about five years. LinkedIn research also found that 89% of professionals feel that skills are more important than job titles.
A lot of what you're referring to is due to the increasing use of AJAX throughout the internet. Forms are submitted using AJAX behind the scenes and the page is updated dynamically without actually reloading. Since it wasn't submitted via a traditional form, there is no POST request on the page, which is what causes the re-submit you're referring to. Look into Unobtrusive Javascript, Behavioral Separation and use jQuery and you'll find how easy it is to accomplish this type of functionality.
There is alot of ajax being done to add a slick non reloading layer to your site. But if you do not want to go that deep into ajax there is also the simple method of redirecting the url after you have submited the form. This will mean the browser can be refreshed etc and it will not resubmit.
As for a single site listing these kinds of recommendations, I do not know of one off hand but would be interested to see if there are any good ones people can recommend
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With