Index.html
<html>
<body>
<table width="200" border="1">
<tr>
<td>
<input type="text" name="name"/>
</td>
<td>
<input type="button" name="Submit" value="Submit" onclick="iframe.document.write(name.value)"/>
</td>
</tr>
<tr>
<td colspan="2">
<iframe id="iframe" name=" iframe " src=" iframe.html"></iframe>
</td>
</tr>
</table>
</body>
</html>iframe.html
<html>
<body>
<table width="200" border="1">
<tr>
<td>
<input type="text" name="name"/>
</td>
<td>
<input type="button" name="Submit" value="Submit" onclick="iframe.document.write(name.value)"/>
</td>
</tr>
<tr>
<td colspan="2">
<iframe id="iframe" name=" iframe " src=" iframe.html"></iframe>
</td>
</tr>
</table>
</body>
</html>iframe.html
<body>
<table width="200" border="1">
<tr>
<td>
<input type="text" name="name" id="content" />
</td>
<td>
<input type="button" name="Submit" value="Submit" onclick="show()" />
</td>
</tr>
<tr>
<td colspan="2">
<iframe id="iframe" name=" iframe " width="100%" scrolling="auto" frameborder="no"></iframe>
</td>
</tr>
</table>
<script type="text/javascript">
function show()
{
var obj=window.frames("iframe");
var source=document.getElementById("content");
obj.document.open("text/html");
obj.document.write(source.value);
obj.document.close();
}
</script>
</body>
</html>
index.html
<html>
<body>
<table width="200" border="1">
<tr>
<td>
<input type="text" name="itemno"/>
</td>
<td>
<input type="button" name="Submit" value="Submit" />
</td>
</tr>
<tr>
<td>
<a herf="鏈接的頁面">鏈接</a>
</td>
<td>
<iframe id="iframe" name=" iframe " src=" iframe.html"></iframe>
</td>
</tr>
</table>
</body>
</html>iframe.html
這個頁面中显示从index.html中按Submit后,itemno中输入的值,取得itemno值的代碼需要寫在iframe頁面中。根據我的需求是想當輸入一個圖片的itemno後,點submit,在iframe頁面內可以顯示出圖片,並且顯示出的圖片上存在鏈接,所以最好把取itemno值的代碼寫在iframe.html頁面中,最後還有一個需求是點index.html頁面中的"鏈接"後,在index.html中的iframe框架中顯示"鏈接的頁面"的頁面。
我個人理解就是用靜態頁面來做的一個簡單的圖片搜索功能,不知是否可否實現。望各位大哥,幫我看看,最好提點意見,謝謝!