What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 134 Stack Exchange communities.

Similar to this question but not quite the same. What are people's thoughts about posting a jQuery solution as an answer to a question, when the question doesn't indicate jQuery, only Javascript?

My 2cents: post a Javascript solution or ask in the comments if jQuery is acceptable. I'm a fan of jQuery myself but I also enjoy coding in plain old Javascript, I think even more so now that jQuery has emerged because I feel like it's more of a niche. Seems that plain Javascript is becoming less used on SO and pretty much any DOM related question has a jQuery answer.

Example question.

share|improve this question
2  
Its fine, as long as you link to this image –  Jamiec Dec 7 '12 at 12:04
    
@jamiec You should totally drop that and try jQuery. –  Tim Post Dec 8 '12 at 5:33
    
@Jamiec hilarious!! uploaded to dedicated image hosting to preserve it for all eternity! :-) –  Shadow Wizard Sep 2 '13 at 14:03

2 Answers 2

up vote 5 down vote accepted

It's fairly typical to see Javascript questions where the author makes it clear that they can't or won't use jQuery for whatever reason. Obviously, an answer suggesting jQuery would not be helpful or well received there.

As far as questions that really don't specify a preference in either direction, just give it your best answer.

Just beware, many would frown upon an answer to a question not specifically looking for jQuery that suggested loading jQuery to do something extremely trivial like hiding a div. In another language, that would be like suggesting one use bcmath to add three trivial integers together.

Your best judgement, as always, should be exercised.

share|improve this answer
1  
+1, I think your comment about trivial functions is key here. –  MrCode Dec 7 '12 at 11:43

You should provide a helpful answer. If using jQuery in your answer would be helpful, use jQuery.

The OP can always indicate that they are not 'supposed' to use jQuery (e.g. they are cheating on their homework), or give other reasons not to use jQuery to indicate your answer wasn't helpful to them.

We see the same issues in other languages. There always will be questions where an external library is the best practice to solve the class of problems. Just use those best practices when answering.

share|improve this answer

You must log in to answer this question.

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