result
load イベント内で作成された変数にアクセスして返そうとしています:
function submit_form_with_file(form, link, file)
{
var iframe = $('<iframe name="postiframe" id="postiframe" style="display: none" ></iframe>');
//append the iframe to the html page
$("body").append(iframe);
result="";
var form = $(form);
...
form.submit();
$(iframe).load(function ()
{
var body=window.frames[$(iframe).attr("name")].document.body;
result=(body.textContent || body.innerText);
alert(result);
});
return result;
}
return result
iframe が読み込まれるまで待ってからresult
、load イベント内で変数を返します。それを達成する方法は?