I need to set an event handler whose job is to return the function in which the handler is being set, and not the anonymous triggerhandler itself. How can this be achieved? See the code below:
if(subFormToServer())
doSuccessDance();
else
doErrorStuff();
function subFormToServer(thaGoods) {
$('<iframe name="subform-target" style="display: none;"></iframe>')
.bind('load', function(){ return 0; }) // how to I "pass" these return statements "up" to my function or "escape" them, so to speak, so that what they're returning isn't the load/error handler functions, but actually the subFormToServer function?
.bind('error', function(){ return 1; })
.appendTo('body');
$('<form method="POST" '+
'action="http://server/formHandler.php" '+
'target="subform-target"> '+
'<input name=inputName value="'+encodeURIComponent(thaGoods)+'">'+
'</form>')[0]
.submit();
}