In many answers I've seen links to JSBin and JSFiddle and found them useful. When asking or answering a question when is it better to put the code directly on the page versus putting a link to the code where it can run?

For example, I wrote some small programs I did to narrow down the cause of a problem and was wondering if I should include the code directly or put them on such a site?

3 Answers 3


An external play-thing version should only accompany a self-contained question, but can be desirable in circumstances where the output is visual and can be set up as an immediate demonstrable example - whenever people might actually need to run your code to help see and fix the issue, this is better than spending even a few moments opening a text editor, saving, browsing to, etc.

Always include the relevant code in the question, though.


My suggestion is to use JSBin or JSFiddle only for generic code which can be helpful to other global users.

JSBin or JSFiddle should be used only for demo purposes, but users should paste the HTML, Javascript and CSS into the question also. That will be helpful for the future (if third party links are broken)

In simple terms:

Never paste client specific code on public sites (Use generic sample code)


Please include the code in the question, but feel free to link to JSBin and JSFiddle, since they are, as you point out, handy.

It's important to include the code so we don't need to go offsite and so that we're not dependent on external websites for content.

One option is to put the minimum code necessary to diagnose in the question and link to the full module externally, but make sure the question is self-contained.

You must log in to answer this question.

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