문제

<iframe data="/localfile.html" type="text/html" width="200" height="200"></iframe>
<iframe data="http://example.com/remotefile.html" type="text/html" width="200" height="200"></iframe>
<object data="/localfile.html" type="text/html" width="200" height="200"></object>
<object data="http://example.com/remotefile.html" type="text/html" width="200" height="200"></object>

IE를 제외한 모든 브라우저 에서이 4 가지 테스트가 모두 작동합니다. IE 6과 7에서 마지막은 실패하고 빈 프레임을 보여줍니다. IE가 객체에 외부 HTML을로드 할 수있는 해결 방법이 있습니까?

도움이 되었습니까?

해결책

IE와 함께 객체를 사용하는 방법에 대한 자세한 내용은 다음을 검토하십시오. http://aplus.rs/web-dev/insert-html-page-into-inother-html-page/

그것은 IE가 기대하는 것과 다른 브라우저에 비해 차이로 요약됩니다. IE의 경우 유형 속성 대신 ClassID 속성을 사용해야합니다. 예를 들어 (위 참조 사이트에서) :

<!--[if IE]>
<object classid="clsid:25336920-03F9-11CF-8FD0-00AA00686F13" data="some.html">
    <p>backup content</p>
</object>
<![endif]-->

<!--[if !IE]> <-->
<object type="text/html" data="some.html">
    <p>backup content</p>
</object>
<!--> <![endif]-->

ClassID는 서버를하려는 컨텐츠 유형에만 해당됩니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top