-5

I came across this question today:

(Following is the very first version)

I have a div tag to which I attach the draggable event of jquery. But when the user drags this div, I would like to create a new dynamic div ( containing additional information ) and attach this div for dragging. So it should appear as if this div is being dragged. How should I go about this ?

Note - I tried attaching mouse down to main div and create dynamic div but attaching mouse events seems to be buggy.


(I agree it isn't great, but it can surely be improved.)

The question was tagged and .

For someone who is not familiar with , It might seem to be a broad or not specific question.

This question is now on hold as off-topic with following reason:

Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers

(emphasis mine)

and there are comments below the question saying this is too broad, tell us what is not working etc.

Now,

  • The question is not asking for debugging help. The OP is not asking the community to fix his code, Instead, he is asking how to do something

  • When I look at it, the question has a clear problem statement - OP wants to display a dynamically generated <div> while dragging rather than the original one being dragged.

  • There is no such thing as code required to reproduce this in this case because there is no particular error happening. The OP simply has a draggable <div>, that's it - And the code for creating it is pretty obvious for someone who is familiar with the tag, because it's a one liner like

    $("div").draggable();
    

    (If one doesn't know the ^ above one liner, and is asking for this code, then he probably isn't familiar with the topic)

  • And If you ask me, it is likely that others might have the same question in future too.


In reality, there is a built in option for achieving what the OP wants in , and someone familiar with using it can point it out.

Now if you ask me, the question could be downvoted sighting the lack of research reason for not finding the docs and understanding it, even though my first google search didn't return anything (I might be using the wrong terms).

For someone familiar with jQuery UI draggable functionality, I don't think this will be off topic.

Now, Did experts voted to close this..?

If not, Should someone not familiar with the topic vote to close something by the looks of it..?

If familiarity with the topic is not the case, can someone tell me, Why this is actually off-topic..?

Update

It looks like many are not understanding the scenario.

The scenario is this:

OP asks how to do X. and mentions something he tried didn't work.

Simply put, my questions are,

  • Does the question become off-topic because he didn't show his failed attempt..?
  • Should one vote to close If they are note familiar with the topic..?

Conclusion:

Back in 2008, question asking How to do X and answers were well received and gained upvotes by those who found it useful later.

In 2014:, Questions caused by typing mistakes of OP and their answers gains upvotes, might not even get closed, and will never get deleted.

Questions asking How to do X and answers will be downvoted as well as closed, unless there is a piece of code which is not at all required to solve the issue, and will be fed to roomba.

Lesson Learned: (As of 2014) I should not answer questions asking How to do X, even though it might be useful to future readers and I can solve the issue, unless OP posts a piece of code (Even though it is not at all necessary to solve the issue). Instead, I should vote to close the question.

Thanks everyone.


Update

The question is now deleted. The information is gone and anyone coming across this issue will come back with the same question.


Side note: My attempt to improve the question or re-open vote doesn't seem to do anything for the past few hours, It is still receiving downvotes and even the answer gets downvoted! (Can't be sure it's related to the question quality though), Which in fact prompted me to bring it here.

26
  • 11
    Why does someone who has 12k+ rep need to ask this?
    – user692942
    Commented Oct 23, 2014 at 14:13
  • 5
    If the code $("div").draggable(); is so common (I admit I'm totally unfamiliar with jquery), why didn't the OP added in the question? How will others - not totally familiar with jquery-ui - figure that he did use that? And why don't you just edit the question and add it, if you are dead sure that's what everyone uses? The question might then be re-opened. I find the close reason perfectly just. Commented Oct 23, 2014 at 14:14
  • 4
    I can visit whatever I like. I visited this question because you added a link to it. I would have voted to close, if it hadn't been closed. Because it seems like the original OP has no idea about what a draggable is. And as Cerbrus notes, there are 2 tags in the question. Someone may be familiar with one of them but not both. Commented Oct 23, 2014 at 14:18
  • 4
    @ypercube That is precisely what I'm asking, If you have no idea regarding the topic, then how can you vote to close it as off- topic..?
    – T J
    Commented Oct 23, 2014 at 14:20
  • 12
    Because I have a general idea about programming and (I think) I can fairly understand when a question is vague and off-topic or not. And because the "must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself." reason stands for it. Did you read the *must include shortest code ...? Commented Oct 23, 2014 at 14:22
  • 7
    I'm more siding with TJ on this one... this question isn't as bad as people here are making it out to be. Downvote worthy? Absolutely! but it isn't off topic... It's probably a duplicate.
    – Kevin B
    Commented Oct 23, 2014 at 14:33
  • 4
    @TJ, re: your edit: Does the question become off-topic because he didn't show his failed attempt..? Yes. Should one vote to close If they are note familiar with the topic..? Being familiar with a particular topic brings very little to the table if the questioner does not provide any information on that topic. Commented Oct 23, 2014 at 14:36
  • 2
    @ypercube The question did include the desired behavior, no specific code was required to reproduce the scenario, And it appears just because you have a general idea about programming you can't figure out the depth of an issue by looking at a question, because in this case for example, there is a direct option in the library in question, and with minor tweaks, you can achieve what is being asked. And since you're not familiar, you don't know.
    – T J
    Commented Oct 23, 2014 at 14:39
  • 3
    @Cerbrus if we use that argument we might as well delete the majority of the jQuery ajax questions too. Oh, and php while we're at it.
    – Kevin B
    Commented Oct 23, 2014 at 14:42
  • 1
    @Cerbrus What..? So you're saying the answers in SO, aren't based on any documentation..?
    – T J
    Commented Oct 23, 2014 at 14:42
  • 1
    A decent programmer first looks at the docs of the language / lib / whatever he's using. If the answer is in there, he should at least have some kind of attempt in hos SO question. Sure, all programming has some base in documentation. But questions asking how a well documented feature works without any code in it are just OP's being lazy.
    – Cerbrus
    Commented Oct 23, 2014 at 14:45
  • 1
    exactly, there's no example of helper: function () {...}
    – Kevin B
    Commented Oct 23, 2014 at 14:49
  • 2
    @Cerbrus The OP was not aware of the option itself. Hence he asked.. It's likely that many others might do. Most of the question asked here can be solved by referring documentation. Hell, jQuery has a neat documentation IMHO. Burn all jQuery questions..?
    – T J
    Commented Oct 23, 2014 at 14:56
  • 2
    I'm done discussing this. It's obvious we don't agree, and we're not going to convince each other.
    – Cerbrus
    Commented Oct 23, 2014 at 15:00
  • 6
    Please don't rant in your question.
    – Sumurai8
    Commented Oct 23, 2014 at 17:12

2 Answers 2

30

Let me change the emphasis for the close reason:

Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers

The OP says they've tried something, but:

  • They didn't include the code for what they've tried
  • They described the result as "attaching mouse events seems to be buggy" which is extremely imprecise. What happened, exactly? On what browser?

The close reason seems entirely appropriate to me.

You claim that there's no code required to reproduce this, and an expectation of what the OP did - but we don't know that's what the OP did. Likewise "there is no particular error happening" doesn't seem to be the case when the OP claims that "attaching mouse events seems to be buggy". If something "seems to be buggy" that indicates to me that the OP has observed some problem - but decided not to tell us about it.

13
  • 6
    +1, That's what I was trying (and apparently failing to) to say.
    – Cerbrus
    Commented Oct 23, 2014 at 14:11
  • 1
    Actually, You didn't understood the problem. The OP is not asking regarding his buggy attempt. He simply mentioned that something he tried didn't work, and asked how to do x. Is it considered off-topic becuase he mentioned something regarding a failed attempt but didn't provide that code..? The question is not at all about fixing his failed buggy code
    – T J
    Commented Oct 23, 2014 at 14:13
  • 3
    @TJ but the failed buggy code may help others understand his problem, won't it? Commented Oct 23, 2014 at 14:15
  • 3
    @ypercube It might or it might not but it is not necessary for the question to stand on it's own...
    – T J
    Commented Oct 23, 2014 at 14:18
  • @TJ The goal of SO is to build a library of useful questions with answers, if they don't include code how is it useful to anyone other than the OP?
    – user692942
    Commented Oct 23, 2014 at 14:20
  • @Lankymart again let's go back to our 2008 example again. please tell me what code does it have, and whether it helps SO to be an information repository without any code or not...
    – T J
    Commented Oct 23, 2014 at 14:23
  • 4
  • 2
    @TJ It's already been pointed out that example is from 2008 and does not reflect the standard of question SO expects now.
    – user692942
    Commented Oct 23, 2014 at 14:25
  • 1
    @JonSkeet, I'm not quite sure whether you saw my previous comment or read the question properly, the question was How to do X, rather than What is wrong with my buggy attempt for doing X. OP's buggy code is not at all required for solving the issue, and it might be useful for future readers. Anyways, I'm glad I got a response from Jon Skeet. thank you for your time sir.
    – T J
    Commented Oct 23, 2014 at 17:17
  • 2
    @TJ: I think it is appropriate for the OP to indicate that they've already tried something - otherwise the question shows a lack of effort - and given that the OP had tried something, they should have shown what they'd tried and given more details of what went wrong. How does a vague "I tried something but it looks like it's a bit buggy" help anyone? Compare that with "I tried X, but it did Y instead of Z" which can lead to explanations and fixes.
    – Jon Skeet
    Commented Oct 23, 2014 at 17:24
  • @JonSkeet As far as I know, from what I've read here - Users were advised to downvote questions without any research effort (That is what the tooltip says), not to flag it or vote to close it. I guess the trend has changed > 2014 ;)
    – T J
    Commented Oct 23, 2014 at 17:43
  • 4
    @TJ: Well if the user had only posted that they hadn't put any research effort in, maybe they'd just have been downvoted. As it is, they showed that they had put research effort in, but couldn't be bothered to tell us what it was. Both seem pretty bad to me. (Personally I'm in favour of voting to close a question with no research effort - particularly those where reading easily-found documentation would immediately answer the question - but I realize that's not what the site rules suggest.)
    – Jon Skeet
    Commented Oct 23, 2014 at 17:45
  • ? The question wasn't seeking debugging help
    – Viliami
    Commented Jul 14, 2016 at 11:52
7

The question is vague; I can't tell what his "this div" is referring to.
It also lacks any kind of code that illustrates the problem, or any attempts at writing a solution.

Heck, even an illustration of the expected result would make this question that much better.

"The OP is not asking the community to fix his code, Instead, he is asking how to do something"
-- Without any kind of attempts to show he's put some effort into the problem.

It's just a typical code request with minimal effort.

8
  • "even a illustration of the expected result would make this question that much better" I'm not quite sure how to do that... that'll be the answer for the question..!
    – T J
    Commented Oct 23, 2014 at 13:58
  • Let's consider this question with 3kupvotes, it doesn't have any attempt to solve the issue as well, it is just asking how to do something. Is it off-topic and should it be closed..?
    – T J
    Commented Oct 23, 2014 at 14:02
  • 1
    That's a question from 2008. That's by no means an example of how SO works, nowadays.
    – Cerbrus
    Commented Oct 23, 2014 at 14:03
  • Heck, the OP even said he "I tried attaching mouse down to main <div>", he should at least have added that to the question.
    – Cerbrus
    Commented Oct 23, 2014 at 14:04
  • His non-working solution is not required for solving the issue, because the question is not about how to fix his non working solution. So a question asking how to do something will be blindly closed as off topic nowadays..?
    – T J
    Commented Oct 23, 2014 at 14:04
  • Yea, most of the times. Otherwise, we'd have hundreds of "how do I draw a circle on a canvas?" questions. In that example, the requirement is clear, but the question is still low quality.
    – Cerbrus
    Commented Oct 23, 2014 at 14:05
  • 2
    hundreds of "how do I draw a circle on a canvas?" - You're talking about duplicates. I couldn't spot an exact duplicate with single search though. I thought low quality should be downvoted, but didn't knew that Nowadays It's blindly closed without a reason which justifies it!
    – T J
    Commented Oct 23, 2014 at 14:09
  • 3
    Except that the close reason does justify it. It seems @JonSkeet explains my opinion better than I can, myself.
    – Cerbrus
    Commented Oct 23, 2014 at 14:11

You must log in to answer this question.

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