22

When looking at the 10 years old question How to reload a page using JavaScript, many answers state that location.reload() can have a parameter. Then there are comments that it is not correct.

The Mozilla docs state that this is not correct.

My question: is it ok/appropriate/acceptable/encouraged to simply edit all the answers to remove the possibility to add the parameter and, anticipating possible comments, point to the docs? (and flag the comments about that point to be deleted)

This is a highly active question so I belive it would be best to go straight for the answer, without ambiguities (I am talking about the true parameter usage, not other ways discussed in some answers)

14
  • 20
    Honestly I think it's not worth it and a better option would be for a mod to simply delete the majority of the answers as they're dupes that add nothing useful. Aug 18, 2021 at 7:54
  • 2
    It will not hurt, though - since you can edit unilaterally, just go ahead and do it - the last thing we need is more code out there that uses behaviour that is not a part of the standard and has never been one since a lot of people just do "copy/paste programming". Aug 18, 2021 at 8:17
  • 13
    To modify a quote from a movie that was popular when I was young, it's every answerer's God-given right to be completely wrong. That's what votes are for. Vote down the incorrect answers (commenting on why if you so choose). Aug 18, 2021 at 13:01
  • 5
    @HereticMonkey and that movie is totally wrong, but that's fine too. We don't want subpar answers here, we want the best ones, so that movie doesn't apply to us. That means that wrong answers that repeat the same thing as other wrong answers should be deleted.
    – Braiam
    Aug 18, 2021 at 13:42
  • 6
    @Braiam I'm not sure how a joke in a movie is "wrong", but whatever. I'm fine with deletion. I'm not so sanguine about editing incorrect answers. We have a process for incorrect answers; we should follow that. Aug 18, 2021 at 14:29
  • @HereticMonkey yes, that's what I'm proposing. The help center is very explicit about it: Any time you see a post that needs improvement and are inclined to suggest an edit, you are welcome to do so. These post needs improvement.
    – Braiam
    Aug 18, 2021 at 15:07
  • 3
    @Braiam That help center article is also quite explicit about the limits on edits. A person is not supposed to select what they consider the "correct" answer and edit all the other answers to match that one. Right? Aug 18, 2021 at 15:25
  • 1
    A function in JS can take any number of arguments regardless how many it declares it should take, so there really is no harm in passing an unneeded deprecated argument instead of none. Aug 18, 2021 at 19:38
  • 1
    @MarcoBonelli: I understand, but passing an argument with the intent to have something happening (that does not happen according to the docs) is misleading
    – WoJ
    Aug 18, 2021 at 20:00
  • 2
    I would just add a new answer with the up-to-date changes. Community wikis aside, editing other people's content should only be done if it doesn't change the intent of the post, even if they put a syntax error and you were just fixing it for them. If you want, leave a comment on the other answers stating it's out of date or otherwise what is wrong with that approach.
    – codewario
    Aug 19, 2021 at 16:33
  • @BendertheGreatest: the problem is that this adds yet one more answer to a stack of existing answers (more or less correct). I think we reached a stage where it is more a philosophical question than anything else: is SO a place to find correct answers (possibly several, each being an alternative) and making sure they stay that way - or - a place where multiple, duplicate and not downvoted answers pile up (the biased tone is on purpose :))
    – WoJ
    Aug 20, 2021 at 8:08
  • @HereticMonkey: If there have been comments on those answers to point out the mistake, and their authors haven't noticed and updated their answers, then they're not doing their part to maintain their answers and it's time for someone else to edit, especially on old highly-upvoted answers that it would take a really long time for a new answer to surpass. Aug 20, 2021 at 14:26
  • @PeterCordes Yeah, being right is hard. It takes a while before people realize you're right. You might actually have to wait before your correctness is recognized on Stack Overflow. How is that different from real life? Aug 20, 2021 at 14:50
  • @HereticMonkey: Stack Overflow can be better than real life cargo-cult / copy-paste info propagation if we want it to be, and that's kind of the ideal for the collection of good answers that we're trying to build. Get consensus on meta if you're not 100% sure that a change is technically right, then do it for the benefit of all future readers. (Meta can also help figure out how to phrase / format changes in ways that don't take over existing answers, just improve, and/or get some review-like attention after you make an edit.) (And yes I'm aware that my views on editing differs from many.) Aug 20, 2021 at 15:05

3 Answers 3

31

Even if this is not in the specs, Firefox actually does support this method, and it seems that some versions of Chrome also did.

I'm not sure what harm it does to have this being mentioned in a Q/A about reloading a document.
Remember that HTML specifications are a Living Standard, I'm not sure we can really aim at having all answers about Web APIs be up to date with them, and I'm quite sure we should not refrain from mentioning features that haven't been standardized yet, even if there is a risk it won't ever be.

So if you really want to go editing these answers, it would probably be better to note that this feature is non-standard rather than removing the information entirely.

As for the MDN article, it has been corrected now.

6
  • 6
    The problem is that a lot of people just copy/paste without thinking whether or not something makes sense :) That said, agreed that the best way could be to add a notice about this being non-standard and not advised to be used. Aug 18, 2021 at 9:44
  • 5
    Good golly, that MDN page was clearly edited with that rant before the current quality-control measures were put in place. It wouldn't make it to publication now. Aug 18, 2021 at 9:50
  • 6
    @T.J.Crowder well... it seems this was added by Michael Smith (@sideshowbarker), so yes, they can still trespass the quality-control measures, since they are said measures :P
    – Kaiido
    Aug 18, 2021 at 9:52
  • 8
    @Kaiido - Wow, that really surprises me. I was sure when you said that that it would just be that they were the one committing what was already in the wiki, but no, sure enough, it was a new change just four days ago. Aug 18, 2021 at 10:01
  • 4
    @T.J.Crowder I don't know if I've seen that much frothing on MDN before; that was disappointing.
    – canon
    Aug 18, 2021 at 15:49
  • 2
    Kudos for teaching me the word "edulcorate" (in the open issue); that's a new one to me!
    – zcoop98
    Aug 18, 2021 at 15:51
14

As mentioned by @Kaiido, it's non-standard but not factually incorrect. Edits can be rejected if they "clearly conflict with the author's intent", and even if your edits don't need to be approved you should make edits that would be approved. (The point of having to earn the instant-editing privilege is that in the process of gaining the reputation for it, you should learn what edits are OK to make.) I think changing the answers so they conform to standards rather than implementations would be a change of intent. It's also entirely valid in Javascript to call a function with more arguments than it accepts; they will just be ignored.

So I would say write your own better answer, explain in it why the other answers are wrong, and wait for the upvotes. It can take a while for your answer to rise to the top, especially when the existing answers have so many votes, but if your answer is better then it will gather votes over time. Ultimately, different answers are supposed to be judged by the voting system.

3
  • 4
    I do not want to add yet another answer to the existing stack. It would just discuss the standards. I would prefer to keep one canonical answer (at least the version with reload) that would aggregate the existing ones, and add a not about the standards
    – WoJ
    Aug 18, 2021 at 11:40
  • 5
    @WoJ In that case, how about editing one of the existing answers which does not use the parameter, to add the fact that the parameter is non-standard?
    – kaya3
    Aug 18, 2021 at 11:44
  • 1
    This would be the best way to go, adds new information without changing the intent of the content author.
    – codewario
    Aug 19, 2021 at 16:35
5

My feeling about edits is: If the author of the answer got something wrong, and has been reminded about that in comments to his/her answer, and he/she doesn't correct it, then keep it wrong. Write a correct answer, or upvote an already correct answer.

On the other hand, standards change. That Boolean argument to location.reload() was commonplace two decades ago, but it has since then been phased out. So what if we have an otherwise perfect answer, that has gotten outdated, and where the original author doesn't have the time to edit his/her old answer? Well, in those cases, go ahead and edit it.

Updating old answers is much more user-friendly than having to read through all the comments below to find out, which aspects of the answer have become wrong over time. But be humble in your edit. For example, mark those old parameters as deprecated, instead of deleting their mention altogether.

2
  • I disagree with your first paragraph. If someone doesn't maintain their own old answers, then expert users in the relevant tech should edit to fix poor examples that show bad / wrong ways to do things. (That's what you say in the rest of your answer, but you're limiting it to cases where the original answer was correct at the time, it seems? Correcting misconceptions in explanations or lurking bugs in examples is a good thing in general that I think future readers will be glad of.) Aug 20, 2021 at 14:35
  • The only thing that makes this a little muddy in this specific case is that apparently JS functions are required to ignore extra args they don't take, so the code will still work on a standard-conforming JS implementation (I think?), not depending on some extension to the spec that most browsers happen to support or something like that. So yeah, agreed with being humble and mentioning the deprecation instead of just totally removing. Aug 20, 2021 at 14:36

You must log in to answer this question.

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