Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

I've seen some answers that suggest alternative methods to do what the OP wants—sometimes these suggestions don't fit into any of the question's tags, but they still fully do what the OP wanted.

Here's one example. The OP asked how to accomplish the task with Javascript, and the answer suggested another way to do it that didn't use any Javascript.

In some cases, the alternatives can be much more closely related to the subject, and then I suppose it's appropriate. But what about in cases like above? Obviously, using another method completely can sometimes be rewarding, but is it really our business to not directly answer the question and suggest another method?

The author came for an answer to the question, and although the code does what it's supposed to, the question is not being answered.

So my question is, is it really appropriate to answer questions like that?

share|improve this question
up vote 7 down vote accepted

If an alternative method is better and more fitting to the OP's needs, it is absolutely okay to suggest it. However, it needs to be clearly explained that it is an alternative, why it is being suggested, and what downsides or upsides it has to the original approach.

In the case you show, that isn't done properly:

  • The "You use" implies that this is the only correct way to do it

  • HTML 5 is not yet universally supported, while JavaScript is

hence I don't think it's a good and valid answer yet. (With some changes though, I think it would be, and it shouldn't be made a comment.)

share|improve this answer
...but even then, I think that specific answer is nice. It adresses what the OP wants to achieve, it teaches some folks new things, and even when not useful today it might be useful tomorrow. That short answer could have been a comment, but I don't mind it being an answer either. (Someone upvoted it too. Heck, so did I just now! I think the "You use" is just the result of a non-native English speaker.) – Arjan Dec 27 '11 at 13:22
@Arjan fair points. I, too, think it's fine as an answer, and it works nicely now with the HTML 5 hint. – Pëkka Dec 27 '11 at 13:44
A link to the old revision for you ;-) – Arjan Dec 27 '11 at 14:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .