I recently posted an answer to this question on SO. OP's sorting issue was easily solved by a plugin for DataTables. He commented that it resolved his problem, but never accepted the answer (Although, it seems he rarely does accept an answer.) Regardless, my answer was 'recommended for deletion' because of the link. I do understand the reasoning against link-only answers. However, I'm asking what should I have done instead?
In this particular case, the plugin consisted of a single file, so perhaps I should have pasted the code to begin with. What about when the answer involves a library of several files? Should I have commented with a link instead of making it an answer?