如何从链接中打开iframe中的特定文件
例如; http://ccgi.vaegar.force9.co.uk/examples/SwingSet2_demo/index.html
我想导航到ButtonDemo,打开链接时,它是如何可能的
我尝试了以下方法,但没有奏效
<a href="http://ccgi.vaegar.force9.co.uk/examples/SwingSet2_demo/index.html?target=ButtonDemo.java.html">ButtonDemo</a>
<a href="http://ccgi.vaegar.force9.co.uk/examples/SwingSet2_demo/index.html?ButtonDemo.java.html">ButtonDemo</a>
提前致谢
答案 0 :(得分:1)
如果您的iframe名称属性为sat {,例如target="myFrame"
,那么您可以在锚标记上使用target属性<a target="myFrame" href="http://ccgi.vaegar.force9.co.uk/examples/SwingSet2_demo/index.html">ButtonDemo</a>
<a target="myFrame" href="http://ccgi.vaegar.force9.co.uk/examples/SwingSet2_demo/index.html">ButtonDemo</a>
<iframe name="myFrame" ></iframe>
你的iframe
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
Here's关于plunker的一个工作示例