Today I discovered a nice service for getting quick answers to programming questions. I had come across StackOverflow.com before, but I actually had a question to ask now so I signed up and asked it. Within an hour, I had some responses, and in two hours I had many possible answers that would all work for me.
The way this site works, from what I gathered from their FAQ, is that anyone can ask a question as long as it is related to programming. Then, as people answer they get awarded reputation, and with certain levels of reputation you can vote up or down answers, then with more rep you can edit answers and so on. It is all community-run, so to speak.
Anyway, results speak for themselves, and as you can see from the question I asked there were a number of attempts at answering it:
http://stackoverflow.com/questions/486896/adding-a-parameter-to-the-url-with-javascript
Testing the answers
I got carried away looking at the answers and trying to figure out which one was better, so I could “accept” one as the right answer. I therefore came up with a page to test the different methods of answering the same question:
Click here to run the test with your own browser
You can look a the code to see the methods, I changed them slightly so they could be plugged in to the project I was working on.
Here are my results, using the browsers I had on my computer (Windows XP SP3 Core2 2.13Ghz):
Chrome |
Firefox 3.0 |
IE7 (on another machine WinXP Pentium D 2.8ghz) |
IE8 RC1 |
Opera 9.63 |
Safari 3.1.1 |