한 페이지를iframe 콘텐츠에 다른 iframe으로 어떻게 액세스합니까?
<div id="editForm_container">
<form id="imageForm" name="imageForm" enctype="multipart/form-data" target="hiddenFrame" method="post" action="test.php">
<label><strong>File Name</strong></label>
<input type="file" name="fileupload" id="fileupload" /><br />
<input type="submit" name="submit_image" id="submit_image" />
</form>
<iframe id="hiddenFrame" name="hiddenFrame"></iframe>
을하고 난 에 다른 페이지에있는 다른 iframe이이 페이지를로드하고 나는이 빈을 반환
$("#imageFrame").load(function(){
this.imageFramecontent = $("#imageFrame").contents();
this.imageFramefields.fileField = this.imageFramecontent.find(":input[ name = 'fileupload' ]");
this.imageFrameform = this.imageFramecontent.find("form#imageForm");
this.hiddenFrame = this.imageFramecontent.find("iframe#hiddenFrame");
this.imageFramefields.fileField.change(function(){
self.imageFrameform.submit();
self.hiddenFrame.load(function(){
alert(self.hiddenFrame.contents().html());
});
});
파일 내 JS에서 쓴 경보. #hidden 프레임 내용을 얻으려면 어떻게해야합니까?
은 같은 도메인에로드 된 모든 iframe입니까? 자바 스크립트 콘솔에서 어떤 오류가 발생 했습니까? – fcalderan
같은 도메인에 있습니다. 콘솔 반환 오류 없음 – user1066679
@ FabrizioCalderan 해결책이있는 경우이 문제에 도움주세요 ... 제발 – user1066679