1

So I encountered a question someone had which I've seen answered before by another person's jsfiddle. The solution I wanted to share is not my own and I don't even fully understand how it works (but I know it does). Therefore I was hesitant to post it as an answer, especially when to paste in the jsfiddle link then I am first required to also include the code snippet that I did not write.

What's the best practice here? Just credit the person in the answer, maybe?

1
  • 1
    If the question is a duplicate of the other question, flag it as such. If you’re going to post a JSFiddle, always include the entire code in the answer itself. If it’s not your own work, always credit the original author. Sep 29, 2017 at 14:50

2 Answers 2

8

JSFiddle's licence specifically states:

All code posted to the site belongs to the poster and no license is enforced.

So you do not have the right to copy the content to SO, even if you provide attribution, as you are not the author, and the author has not licensed the code in a way that gives you permission to redistribute it here.

If the same code is posted elsewhere, and that other location provides a license that would give you permission to re-distribute it on SO, then it would be appropriate to incorporate it into an answer on this site.

2
  • 2 followups: 1) But what if the JSFiddle snippet shows up on the author's public dashboard? 2) The statement you cited from the website, is it not to govern the relationship between poster and JSFiddle? I interpreted it as JSFiddle saying to the poster 'your code is yours, we don't enforce a license on the code you write on our site.' Might that leave my original question unanswered? Does your sentence "JSFiddle's license states..." frame its policy accurately? I find it odd to call it a license considering none is enforced; it seems more like a section addressing questions around licensing.
    – lukkyjoe
    Sep 29, 2017 at 15:15
  • 3
    @lukkyjoe If the author of that code posts it somewhere else, somewhere besides JSFiddle, and that other place provides some license to the code that gives you permission to redistribute it on SO, then you would be able to do that. You haven't stated that the code is provided anywhere other than JSFiddle, so we of course can't assume that any other license is given for the code. You are correct that this license doesn't prevent that author from granting other license, but the point is the author will still need to grant some other licence, somewhere, for you to be able to use it here.
    – Servy
    Sep 29, 2017 at 15:18
0

Yes (as link), but your answer must meet SO guidelines.

  • JSFiddle does not have any particular license to share code, so you can't copy-paste code into an answer
  • Answer must stand by itself without link - so answer must include at least clear explanation of the solution, preferably with code.
  • If you found code somewhere else with license that allow pasting to SO make sure to provide attribution.

Notes

  • Make sure question is on-topic before answering. If it is "asker was looking for examples" type of question (as hinted in original version of this q) then it could be off-topic and instead of providing an answer one should vote to close as "search for tools/off-site resources" or edit question first to become on-topic.
  • if you "don't even fully understand how it works" (as added to updated version of the post) it may be better to avoid providing an answer altogether and just add link as comment. Without understanding how code works you only will be able to provide a link as an answer which is not a good format for answers leading to likely downvotes.
2
  • Thank you. And I did not mean to say the asker was looking for examples. The original SO question did not ask for that; that was my inaccurate recount. I will correct my wording. I believe my original question is unaffected though.
    – lukkyjoe
    Sep 29, 2017 at 15:24
  • @lukkyjoe I've updated notes with your edit. As this questions states currently I don't think it would be wise to answer SO question with link as providing good quality post requires understanding of solution. Sep 29, 2017 at 15:35

You must log in to answer this question.

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