38

I get really fed up when the most popular question on a given JS subject asks for jQuery answers and as a result, jQuery-free answers are hard to find.

For instance, I just came across How can I upload files asynchronously using jQuery?, the top answer to which uses jQuery (the title didn't mention jQuery before this post).

I tried excluding the jQuery tag in my search query but I didn't find any well-rated questions. It turns out all the good non-jQuery answers are nestled among other answers to this question.

Thinking the non-jQuery answers didn't really belong there, I opened a "How can I upload files asynchronously without jQuery?" question: How can I upload files asynchronously without jQuery?

Yet within minutes people had voted to close it as a duplicate thinking that their non-jQuery answers to the original question (which are buried under a bunch of jQuery answers) are sufficient and easy enough to find.

But I think this does the community a disservice, and closing my new question as a duplicate should be discouraged. I want to make it more likely for people to be able to find the non-jQuery to any given question instantly. How can we help do that?

Proposals

Non-jQuery answers tend to pile up deep down in popular jQuery questions because that's where the authors can get the most reputation. The incentives are against opening a separate question.

But if it were possible to move the non-jQuery answers to a more on-topic question after the fact, without loss of reputation for the authors of those answers, it would eventually solve the problem without discouraging people from answering in the first place.

Another potential solution would be answer tags. By tagging an answer as no-jquery, the author would make it possible for users to search specifically for a non-jquery answer (even if the original question specifically asks for jQuery).

30
  • 11
    @numbermaniac: I don't think Andy is the one that needs to hear this.
    – BoltClock
    Commented Oct 31, 2017 at 4:31
  • 4
    Those two answers linked here dont really belong there if the question explicitely asks for jquery
    – Suraj Rao
    Commented Oct 31, 2017 at 4:58
  • 20
    I vote for a new jQuery.SE (only half joking).
    – user4639281
    Commented Oct 31, 2017 at 5:03
  • 3
    I want to make it more likely for people to be able to find the non-jQuery to any given question instantly. - Why? If someone has a genuine problem that they intend to solve without using jQuery, sure, go ahead and post that question. Why must you have a non-jquery answer to any given question instantly? Commented Oct 31, 2017 at 5:44
  • 16
    @NisargShah helping people find the right answer to their question as quickly as possible is pretty much Stack Exchange's mission, right?
    – Andy
    Commented Oct 31, 2017 at 6:32
  • 1
    @numbermaniac yes, I updated my introduction to explain how questions that ask for jQuery can become the most popular answer for a general subject (like file uploading). My question is how to make it easier to find alternative answers.
    – Andy
    Commented Oct 31, 2017 at 6:46
  • 2
    @Andy If you want to make the answer more easily accessible without stealing credit, perhaps you can post the answer on your question as Community Wiki, and in the answer link back to where you got it from. Commented Oct 31, 2017 at 6:58
  • 5
    @numbermaniac CW doesn't alleviate the issue of plagiarism. Even credited, we don't just want answers pointing to other answers.
    – Rob Mod
    Commented Oct 31, 2017 at 7:39
  • 8
    The first step would be to stop posting jQuery answers to non-jQuery questions.
    – Teemu
    Commented Oct 31, 2017 at 8:50
  • 1
    Part of the problem is that many people actually think jQuery is pure Javascript. the amount of times I've had to explain the difference to new OPs. Not to mention the mistagged questions, etc. jQuery is so omnipresent these days I sometimes wonder if it should just be adopted by the standards so everyone can just move on.
    – Liam
    Commented Oct 31, 2017 at 9:13
  • 8
    Oh boy, you're not the only in this boat. When I'm searching for a solution to my javascript problem, I have added -[jquery] and I get even jQuery answers... Those answers even gets upvotes while that is not justified IMHO. But eventually I can find my answers after scrolling around...
    – KarelG
    Commented Oct 31, 2017 at 9:44
  • 4
    The only practical solution is to add the [jquery] tag to questions whose accepted answer use jQuery. Even when the question didn't ask for it. Surely a lot of them already have the tag so it is merely an effort to sweep up the stragglers. Be sure to do so when you run into such a Q+A, many hands might light work. Commented Oct 31, 2017 at 10:01
  • 3
    Knew the meme would come back to haunt SO @HansPassant
    – Suraj Rao
    Commented Oct 31, 2017 at 10:10
  • 7
    @g00glen00b The tag wiki says: "Unless a tag for a framework or library is also included, a pure JavaScript answer is expected for questions with the javascript tag." To me that says, that if [jquery] is omitted, no jquery answers should be posted. If you want to speculate, whether jQuery is "pure JS", I'm not in.
    – Teemu
    Commented Oct 31, 2017 at 10:11
  • 3
    You could just create a Greasemonkey script, and then use some jQuery to crawl the list of questions and filter out all jQuery answers. That's probably the best way to do this, since it uses jQuery.
    – Erik A
    Commented Oct 31, 2017 at 21:23

4 Answers 4

9

First off... That's kind of a lousy question. And I don't just mean it's lousy because you omitted any details as to what you were trying to do; you posted it having already found the answer you were looking for on the question you linked to, and just wanted someone to spoon-feed it to you. You could've at least given it a fig leaf by suggesting that there was something missing there, or something you didn't quite understand.

Anyway... To your broader question here, I think the reason why it's generally difficult to find "no jQuery" answers is that folks don't generally look for "no jQuery" questions - they tend to look for solutions to problems in whatever context they're actually working. So you get,

...you get the idea. Folks tend to describe their platform and constraints, leaving folks familiar with the platform free to answer within the bounds of those constraints. For the first few years Stack Overflow was around, the answer to an awful lot of client-side scripting questions was either "use this steaming pile of hacks and browser-sniffing" or "use jQuery and these few lines of browser-agnostic logic" - so it's no wonder the latter kinda took over; heck, for an awful lot of folks still supporting IE, it's still by far the better option; the chances of getting permission to support some internal LoB app two years down the road are slim enough as it is.

That said... If jQuery is something you simply can't or won't support, and you can't be bothered to just learn from the source for jQuery's ajax routine (it's short...) or read up on the Fetch API (also short - but no IE) then just put that in your question. Explain what you need, why you need it, and oh yeah search first since writing a decent question is still probably more time-consuming than just reading the answers to existing questions.

But if it were possible to move the non-jQuery answers to a more on-topic question after the fact, without loss of reputation for the authors of those answers, it would eventually solve the problem without discouraging people from answering in the first place.

I've done this a few times to help with the curation of commonly-asked questions. I wouldn't do it in this particular scenario unless there was some evidence that it was gonna help. The question you're turning up your nose at has over a million views; chances are, some of those answers were added there because they found the question, didn't want to use jQuery, and wanted to save future readers a bit of time. Moving 'em to a new question subverts that intent. Could we accomplish the same with carefully-crosslinked questions? Maybe; but right now, all the answers fit on a single page - it's a one-stop shop for folks with the question "how to upload files asynchronously". There's no reason to expect it isn't doing its job.

See also:

6
  • we should note that someone changed the title to mention "with jQuery" since I posted this meta question, so it may be less clear to visitors that it's a one-stop shop regardless of which library one wants to use.
    – Andy
    Commented Oct 31, 2017 at 19:42
  • Yeah, someone else rolled that back.
    – Shog9
    Commented Oct 31, 2017 at 19:55
  • 3
    @Andy I rolled it back, as I felt it invalidated existing answers.
    – Kevin B
    Commented Oct 31, 2017 at 20:05
  • 6
    -1; the supposed "one-stop shop" is tagged with jquery and explicitly asks for solutions that use jQuery in its body. The first non-jQuery answer is TEN answers down the page if you order the answers by votes, and while it's better than nothing, it's not a great answer, in that it invites you to use the XMLHttpRequest's send method, passing something named file, but gives no indication of what sort of object file should be or how to get one. This is a long, long way from the experience we should be aiming for for non-jQuery readers.
    – Mark Amery
    Commented Oct 31, 2017 at 22:08
  • @Shog9 that's a good point that I didn't write my question well enough to stand on its own.
    – Andy
    Commented Oct 31, 2017 at 22:16
  • 2
    How's that a reason to ensconce the answer in a new question, @Mark? If anything, that's something that might motivate someone to write a sincere question asking for a different answer.
    – Shog9
    Commented Oct 31, 2017 at 23:12
6

I think the issue is that the question shouldn't have been closed as a duplicate in first place. The scope of the issue is different compared to the one. Even though answers of question A could perfectly apply to question B it doesn't mean that they're necessarily duplicates. This is the consensus according to Does the same answer imply that the questions should be closed as duplicate.

Except voting to reopening the question and mentioning this to the reviewers, I don't think there's any other proper solution.


You could create tags like , but then you could start adding [no-*] tags for every other JavaScript framework. The issue here is that they don't describe what your question is about, they just describe what it isn't about, which is anything else (you'll end up with a lot of tags).

You could create a tag (as proposed by Br2), but that's going to be quite confusing. I don't really believe this to be necessary either, you can already filter using -[jquery]. If you're searching for a specific problem/solution, this will already reduce the amount of results greatly, after that you'll have to read the answers you're left with and to manually filter out the jQuery solutions.


Another proposed solution is to stop answering non-jQuery questions with jQuery answers and the other way around. Well, in my opinion, it depends on what you define as a non-jQuery question.

If the question mentions that answers should not be about jQuery (like your question), then yes, people shouldn't answer them with jQuery answers. If people would really want to share that it could be a lot easier using jQuery, then they should probably post a comment like this:

Even though this question isn't about jQuery if you're looking for a jQuery solution you could check this answer.

This happens on Meta all the time, where people post links to related questions like this:

Related: How can I upload files asynchronously using jQuery?

However, if a question doesn't mention explicitly that jQuery shouldn't be used, then a jQuery answer is a valid answer. That's basically the same as asking: "How do I do X?" and answering it with "You can do X by using library Y like this: ...". This sounds like a valid answer to me.

I noticed that the tag wiki of JavaScript mentions otherwise:

Unless a tag for a framework or library is also included, a pure JavaScript answer is expected for questions with the tag.

But I personally disagree with it. For example, take this answer. The question is only tagged with , but the answer uses a third party solution, is that a bad answer now as well? People recommend solutions using other libraries all the time, and as long as they're answer the question, then that answer should be perfectly acceptable, JavaScript or no JavaScript.

18
  • 1
    According to the tag wiki, jQuery answer is not valid, if jQuery is not tagged.
    – Teemu
    Commented Oct 31, 2017 at 10:13
  • @Teemu I noticed that, but I think that's a weird thing. We don't do that for other tags either, why would JavaScript be an exception? People answer questions all the time by mentioning that something could be done by using framework XYZ. Commented Oct 31, 2017 at 10:16
  • I rarely participate other tags, so I've no experience of the common practises on other tags. But pushing an arbitrary library (any library, not just jQuery) to an answer to a simple question, even answers to questions which explicitly mention "no jquery", doesn't show a good understanding of the question, IMHO. I can understand library recommendations to questions, which would be overly broad without the library.
    – Teemu
    Commented Oct 31, 2017 at 10:28
  • If the solution using jQuery is well-defined and solves the actual problem, then why wouldn't show a good understanding of the question? Commented Oct 31, 2017 at 10:31
  • 3
    A jQuery solution to a question saying "Please, no jQuery" shows more arrogant, than understanding. Also, if the tag wiki would have been taken seriously, OP wouldn't even have a problem ..? I've also seen cases, where an answerer has added jQuery tag to the question after given a jQuery answer.
    – Teemu
    Commented Oct 31, 2017 at 10:32
  • I agree with that, that's why I mentioned in my answer that it's an entirely different situation if the question says that you don't want to use jQuery. But as long as you don't mention in the question that you don't want to use jQuery, and solely tag your question with javascript, then a jQuery answer should be permitted. I updated my answer to clarify this by adding emphasis that these are two separate cases in my opinion. Commented Oct 31, 2017 at 10:34
  • Tags are also a big help when searching posts, I can't see any benefit to mix up "vanilla JS" and jQuery. After all, we're building a repository of the good questions and answers, not just answering questions. A good repository can be good only if it is searchable. Which was the OP's original problem here.
    – Teemu
    Commented Oct 31, 2017 at 10:37
  • @Teemu You have a point, but I think people are now abusing the JavaScript tag (+ wiki) to make a difference between a vanilla JavaScript question and a JavaScript question. In many cases, the OP (and other readers) might actually be helped by a jQuery answer, because they didn't know their problem could easily be solved by using jQuery. If there's really a need for a tag for only vanilla JavaScript questions, then I guess the downvoted answer from Br2 isn't that bad. Commented Oct 31, 2017 at 10:44
  • That's true, abusing the tagging system is probably the root cause here. Unfortunately it has continued for so long time, that it's not possible to fix maybe more than a million posts.
    – Teemu
    Commented Oct 31, 2017 at 10:51
  • 1
    "Even though answers of question A could perfectly apply to question B it doesn't mean that they're necessarily duplicates" HOLY! Someone else said it and it wasn't me!
    – Braiam
    Commented Oct 31, 2017 at 11:05
  • " For example, take this answer." That question is off-topic anyway and yes it does make the answer bad for the question if the question asked for vanilla JS only and the answer gave a jQuery answer.
    – TylerH
    Commented Oct 31, 2017 at 14:31
  • @TylerH sure, but the question isn't asking for vanilla JS only, but it is tagged with javascript, and according to the tag wiki, it should only get vanilla JS answers. The tag wiki right now is confusing and that's what I tried to clarify, even if the question is off-topic (which you fixed). Commented Oct 31, 2017 at 14:45
  • @g00glen00b you should make a suggested edit to the tag wiki
    – TylerH
    Commented Oct 31, 2017 at 14:46
  • @TylerH I was planning to do that, but I'm waiting to see what anyone else has to say about that so we could reach concensus. Certainly considering that that edit has been there for a while, and has been made by a high-rep user. Perhaps I should create a separate question for it though. Commented Oct 31, 2017 at 14:51
  • 2
    @Andy: "for instance SO could even specifically add a "Select libraries" input" Which would require answerers to recognize that jQuery is a library that is distinct from JavaScript. Isn't the lack of such recognition the very source of this problem? And what of answers that provide solutions that use multiple frameworks? Commented Oct 31, 2017 at 17:31
2

You could add -[jquery] to your search, but that's likely going to result in you getting mostly poor solutions.

In this specific case the jquery themed question obviously has several answers that cover the non-jquery specific cases. However, even the jquery specific cases show you the change you would need to make to a non-jquery ajax request to support file uploads.

I don't think this is a problem worth doing something about. The specific case you chose to make this stand on clearly isn't a strong one.


Moving the non-jquery answers to non-jquery questions is a negative for the answer. You'd be moving the answer from a location where it will get viewed more to a location where it will be forgotten.

3
  • What do you think about answer tags as a solution to this?
    – Andy
    Commented Oct 31, 2017 at 16:47
  • i'm not sure how i feel about answer tags. answers should first and foremost answer the question asked, so at most i could see an answer having more tags than the question? but not less. i don't think it would be that useful
    – Kevin B
    Commented Oct 31, 2017 at 17:12
  • @Andy Also, -> meta.stackoverflow.com/questions/286607/tags-on-answers
    – Kevin B
    Commented Oct 31, 2017 at 18:57
-15

I guess that you are looking especially for vanilla JS options, since I think that an Angular solution won't be what you look for either. How about the vanilla-javascript tag?

16
  • 10
    I'm pretty sure we already have a vanillaJS tag: [javascript]. Also, the tag wiki offers clear guidance how to use the tag.
    – Teemu
    Commented Oct 31, 2017 at 8:52
  • 1
    I disagree. vanillaJS seems to be something different. And vanilla-javascript is already a synonym for javascript. A new tag isnt necessary
    – Suraj Rao
    Commented Oct 31, 2017 at 8:53
  • I don't intend on creating a new tag, but the javascript tag is often applied in jQuery questions. The tag about vanilla js should not be.
    – Br2
    Commented Oct 31, 2017 at 9:09
  • How would this solve anything?
    – Liam
    Commented Oct 31, 2017 at 9:17
  • 3
    Well, asking a question about vanilla javascript should yield answers about vanilla javascript, without jQuery answers.
    – Br2
    Commented Oct 31, 2017 at 9:22
  • and how does that differ from the javascript tag?
    – Liam
    Commented Oct 31, 2017 at 9:43
  • 7
    @SurajRao did you read vanillaJS webpage? Commented Oct 31, 2017 at 9:46
  • @el.pescado well yes..it is meant to be a gag. adding a separate vanillaJS tag will only add to confusion
    – Suraj Rao
    Commented Oct 31, 2017 at 9:57
  • 1
    @Teemu The problem of the [javascript] tag is that it is applied to non-vanilla javascript questions too.
    – Br2
    Commented Oct 31, 2017 at 10:40
  • Yes, I can agree with that. But the searching mechanism allows you to exclude tags too, that way you can exclude ex. jQuery or many more llibraries if you want.
    – Teemu
    Commented Oct 31, 2017 at 10:43
  • @Liam it probaby differs because the JavaScript tag doesn't necessarily mean that the question specifically asks for something to be written in vanilla JavaScript. This proposed tag would guarantee that, which would make it easier to search for vanilla JavaScript solutions. Commented Oct 31, 2017 at 13:25
  • 1
    Ok and how do you intend to guarantee this? There are so many flaws in this argument.
    – Liam
    Commented Oct 31, 2017 at 13:27
  • 1
    @Liam the vanilla-js tag should only be applied to tags that specifically ask for vanilla JS solutions and nothing else. How it's guaranteed? By the community cleaning up that tag from questions it doesn't belong to and by the community by flagging answers that do not use vanilla JS as NAA to such questions. Or at least, that's how I think Br2 sees it. Commented Oct 31, 2017 at 13:33
  • That's indeed what I meant.
    – Br2
    Commented Oct 31, 2017 at 15:02
  • 1
    @Teemu like some others here, I think javascript will never work as well as a vanilla-javascript tag. I imagine there have to be tons of jQuery questions out there that include the javascript tag. I have to wonder if anyone is going to take the time to clean up tagging on all of the non-vanilla JS answers. In an ideal world everyone would know that javascript is for vanilla JS answers only, but lots of people are going to forget/not RTFM.
    – Andy
    Commented Oct 31, 2017 at 16:52

You must log in to answer this question.

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