function amiright(){
// first, define the variable in the function body:
var response = {};
// then use it in the callback:
ajax.call(function(){
response.answer = 'nope';
});
// now you can return the object and your ajax
// callback will update the property when it's finished.
return response;
}
I don't like one-size-fits-all rules. Either the answer is good or not, and people will vote accordingly (as, by definition, the "goodness" of the answer is measured by voting).
If we want to display a popup to help guide people who actually care, but don't know how, to post better-than-average content, then show a popup. Even better if it helps people feel more justified in downvoting.
But there are plenty of scenarios where answers may contain nothing more than code-formatted text (which isn't the same as "code-only", but we have no way of telling the difference). I've written answers where the meat of the answer was in comments. Any text around the code block was really superfluous and unnecessary. Requiring that wouldn't make any sense, and would only act as a barrier to people who want to post potentially good content. Seeing as participants are spending a bunch of their valuable time, for which they receive no compensation, I don't see why we need to add another hurdle for them to get over.
Don't block answers just because the formatting rubs you the wrong way.
Blah blah blah hate this stupid requirement.
function amiright(){
// first, define the variable in the function body:
var response = {};
// then use it in the callback:
ajax.call(function(){
response.answer = 'nope';
});
// now you can return the object and your ajax
// callback will update the property when it's finished.
return response;
}
(see requirement-getting-around in action: Typeahead.js v0.10.1 and Bootstrap 3Typeahead.js v0.10.1 and Bootstrap 3)