作者:H一直都在好麼 | 来源:互联网 | 2023-05-19 12:34
ImtryingtoshowanxmlfileinaHTMLpageusingiframebybringingthecontentthroughjQueryby
I'm trying to show an xml file in a HTML page using iframe by bringing the content through jQuery by altering the source attribute.
我试图通过改变source属性通过jQuery引入内容,使用iframe在HTML页面中显示xml文件。
When I open the iframe on my browser (Firefox/Chrome/IE8), it opens fine just as below:
当我在浏览器(Firefox / Chrome / IE8)上打开iframe时,它打开正常,如下所示:
But when the same document rendered using an iframe, the xml is being parsed as HTML and displayed as shown in the image below:
但是当使用iframe呈现相同的文档时,xml将被解析为HTML并显示如下图所示:
I have set proper headers and when I checked on the network tabs in the console, it is showing proper result:
我已经设置了正确的标题,当我检查控制台中的网络选项卡时,它显示正确的结果:
I'm not able to figure out a proper way which will display the XML properly under the iframe. Tried various solutions posted on different forums but it does not seem to be working.
我无法找到一种在iframe下正确显示XML的正确方法。尝试在不同的论坛上发布的各种解决方案,但它似乎没有工作。
Thank you!
2 个解决方案