I have the following HTML code for my file upload
<div id="status"></div>
<iframe name="upifrm" src="" style="display:none;"></iframe>
<form name="myForm" id="myForm" action="upload.php" method="post" enctype="multipart/form-data" target="upifrm">
<label for="fileinput" id="brsbtn" class="labtrigg">label</label>
<input type="file" id="fileinput" name="file" />
</form>
<div id="atchs"></div>
and at the end of my upload.php file I have
// . . . . . . . . . . . . .
// $message declaration . . .
echo '<script>
parent.document.getElementById("myForm").reset();
parent.document.getElementById("status").innerHTML="'.$message.'";
$("#atchs", window.parent.document).after("<span>something</span>");
</script>';
the first two lines work perfectly (they are written in pure Javascript code), but I get the error on the third line
$("#atchs", window.parent.document).after("<span>something</span>");
"Object expected". How can I solve this problem?
$("#atchs", window.parent.document).("<span>something</span>");
in your iframe ? do you have jquery included in the iframe ? – t.niese Apr 27 at 13:55window.parent.document
< are you sure that this doesn't result inundefined
? – bwoebi Apr 27 at 14:02