简体   繁体   English

可以做些什么来集中在 iframe 中打开的 .mht 文件? 我究竟做错了什么?

[英]What can be done to focus the .mht file to open in iframe? What am I doing wrong?

I'm trying to use the below code but it is not working.我正在尝试使用下面的代码,但它不起作用。

 $('li.link').click(open() { var value = $(this).attr('id'); $container.cycle(id.replace('pager_', '')); window.open(value + ".mht", 'myFrame'); return false; });
 <iframe allowtransparency="true" frameBorder="2" src="https://www.example.com" name="myFrame"> </iframe> <li onclick="open()" id="xyz" class="link">xyz</li> <li onclick="open()" id="abc" class="link">abc</li> <li onclick="open()" id="mac" class="link">macro sed</li> <li onclick="open()" id="asf he" class="link">asf he</li>

when I click an item from the list it is displaying a blank window.当我从列表中单击一个项目时,它显示一个空白 window。 How do I display the actual.mht file in the iframe.如何在 iframe 中显示实际的.mht 文件。 files placed inside the folder where the html is placed.文件放置在 html 所在的文件夹中。 Any solution appreciated.任何解决方案表示赞赏。

I found a simple solution using a href sorry to bother you guys..我找到了一个使用href的简单解决方案抱歉打扰你们..

 <ol class="side"> <li> <a href="http://example.com/" target="myFrame">example.com</a></li> <li> <a href="https://w3schools.com/" target="myFrame">w3schools.com</a></li> <li> <a href="http://test.com/" target="myFrame">test.com</a></li> </ol> <center><iframe allowtransparency="true" id="myiframe" frameBorder="5" src="http://example.com" scrolling="yes" name="myFrame"> </iframe> </center>

For some reason this is not working in snippet but works as html file.由于某种原因,这在片段中不起作用,但作为 html 文件起作用。 It seems i'm thinking too much.看来我是想太多了。

By this way most file types can be displayed in iframe通过这种方式,大多数文件类型都可以在 iframe 中显示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM