12

I have stumbled upon too many questions asked by new members where they ask for solutions using JavaScript to manipulate the DOM, but instead of sharing the generated HTML on their browsers, they share the portion of the server code that generates views which makes their case irreproducible.

They also tag server-side technologies like , , while those tags are irrelevant for the issue that is being isolated in the frontend.

What is the ideal action to take here?

6
  • 10
    Close as needs clarity / debugging details? Pretty straightforward. Technically, one can repro from a template, but the onus is not on us to do the work for OPs. Mar 12, 2022 at 13:43
  • 1
    @OlegValteriswithUkraine You can't reproduce when the template is using variables
    – medilies
    Mar 12, 2022 at 13:43
  • 1
    I said technically :) It should not be impossible to infer the actual data, but I agree that should not be done and be fixed by the OP instead. We have a close reason just for that - flag as such and when you reach 3k - VTC. Alternatively, drop by SOCVR chat room and post a cv-pls request (provided the room requirements for one are met, of course) Mar 12, 2022 at 13:48
  • 12
    Do you need to reproduce it to be able to answer it properly? If so, then flag/vote to close it. If the question is clear and answerable even without reproducing it and it isn't otherwise off-topic, then find a duplicate for it and if none exists, answer it.
    – Ivar
    Mar 12, 2022 at 13:51
  • 2
    What is frustrating is after being asked to share the rendered HTML they seem to not understand or know how to do it.
    – medilies
    Mar 12, 2022 at 14:23
  • 3
    You don't need to reproduce anything; you just invoke your psychic debugging skillz. Mar 12, 2022 at 17:22

1 Answer 1

5

It seems that such questions need essential detail for answerers to be able to provide solutions rather than taking shots in the dark based on their interpretation of the problem. Thus, questions like that are not a good fit for Stack Overflow until the author edits them into shape.

The workflow for dealing with questions that lack a Minimal Reproducible Example (MRE) or necessary detail is pretty straightforward:

  • If you have enough reputation to vote to close (VTC), choose either a "needs details or clarity" or "needs debugging details", preferably the latter as it lets the author know they should include a proper example for potential answerers to work with.

  • If you have enough reputation to flag posts, proceed as the above.

  • If you are out of votes / flags, or simply feel like it, drop by SOCVR chat room and post a request there for other curators to deal with provided the request satisfies the room rules (no involvement rule in particular). Expect that any such request can be disputed by members of the room.

  • Edit the post into shape and / or find a suitable duplicate target. Oftentimes, the problem has nothing to do with the generated markup and is simply about the usage of the DOM API. If that's the case, fixing the tags and clarying the post is an option (although it is in no way a requirement that you do that — it's the author's job to take care of their posts).

2
  • 3
    Hmm. And here I thought such questions were begging to be answered with: "Don't manipulate the DOM ex post facto with JavaScript. You are the one building the HTML code in the first place, so build it to do exactly what you want it to do." And, in that case, the template code is precisely what you want, not the generated DOM. Mar 12, 2022 at 15:46
  • 1
    @CodyGray well, I don't disagree - the best thing would be not to manipulated the generated markup in the first place, but I guess sometimes it's unavoidable - think about elements that require on-demand loading of data; DSL (dynamic script loading) and such; userscripting. But it really depends on the question, I must admit. Mar 12, 2022 at 15:50

You must log in to answer this question.

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