this same code was working yesterday, iframe[0].contentWindow.document.body.innerHTML has value "success". But, today iframe[0].contentWindow.document.body is "". I cannot find innerHTML. Same is result of iframe[0].contentDocument.body.
html
<form id="formid" method="post" action="file/upload" enctype="multipart/form-data" target="frame">
<input id="" type="file" name="file" />
</form>
<iframe id="frame" name="frame" width="0px" height="0px" frameborder="0"></iframe>
js
var iframe = $('#frame');
document.getElementById("formid").submit();
$("#frame").ready(function(){
$("#frame").load(function () {
data = iframe[0].contentWindow.document.body.innerHTML;
if(data == "success"){
successFunction(); // calling function if success
}
});
});