传参数给iframe页面问题?(剛沒把問題說清楚,重開一貼,望大家再幫我看看) 最简单的就是把表单的 target 设置为 iframe 的 name ,作一个最传统的表单提交动作 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 meizz(梅花雪) ( ) 信誉:709 最简单的就是把表单的 target 设置为 iframe 的 name ,作一个最传统的表单提交动作梅花雪大哥可否把問題說明白點,我的要求是靜態頁面來完成,提交表單好像不能在靜態頁面中取值吧!1 <html><body><table width="200" border="1"> <tr> <td> <input type="text" name="itemno" id="itemno"/> </td> <td> <input type="button" name="Submit" value="Submit" onclick="window.frames['iframe'].location='iframe.htm?itemno='+document.getElementById('itemno').value"/> </td> </tr> <tr> <td> <a herf="鏈接的頁面">鏈接</a> </td> <td> <iframe id="iframe" name=" iframe " src=" iframe.htm"></iframe> </td> </tr></table></body></html>---iframe.htm-----------<script language="javascript"><!--function getParam( name ){ str = location.search.substr(1); re = new RegExp( "(^|&)"+name+"=([^&]+)", "i" ); res = str.match(re); if( res ) return res[2]; else return null;}alert(getParam( "itemno" ));//--></script>取到值之后显示图片加链接就略了 看看这样是否达到了需求:index:<input type="button" name="Submit" value="Submit" onclick="window.iframename.setImg(document.getElementById('itemno'))"/>iframe:<head><SCRIPT LANGUAGE="JavaScript">function setImg(img){ document.getElementById('itemno').src=img;}</SCRIPT></head><body><img src="" id="itemno"></body>至于让iframe显示link页面:<a herf="鏈接的頁面" target="iframename">鏈接</a><iframe id="iframe" name="iframename " src=" iframe.html"></iframe> EXT JS4.1 切换grouptabpanel 后样式不改变 如图 使用jQuery实现checkbox的全选、全取消时遇到的问题(操作无法对头部起作用) 在javascript里面想用for in 语句把<select>里面的Option值和文本取出,应该怎么写呢? 请问这个JS用什么方法压缩的? 如何防止.js的脚本被盗链? 高手看看这个奇怪的问题!!!!!!! javascript怎么画圆圈 OA系统中的一个大问题,大难题, 请问:可以通过href传递参数吗? 大家看看这里标//有什么错误 欢迎加入qq群6257833讨论java ,javascript技术 这句话该怎么写
最简单的就是把表单的 target 设置为 iframe 的 name ,作一个最传统的表单提交动作梅花雪大哥可否把問題說明白點,我的要求是靜態頁面來完成,提交表單好像不能在靜態頁面中取值吧!1
<body>
<table width="200" border="1">
<tr>
<td>
<input type="text" name="itemno" id="itemno"/>
</td>
<td>
<input type="button" name="Submit" value="Submit" onclick="window.frames['iframe'].location='iframe.htm?itemno='+document.getElementById('itemno').value"/>
</td>
</tr>
<tr>
<td>
<a herf="鏈接的頁面">鏈接</a>
</td>
<td>
<iframe id="iframe" name=" iframe " src=" iframe.htm"></iframe>
</td>
</tr>
</table>
</body>
</html>
---iframe.htm-----------
<script language="javascript">
<!--
function getParam( name )
{
str = location.search.substr(1);
re = new RegExp( "(^|&)"+name+"=([^&]+)", "i" );
res = str.match(re);
if( res ) return res[2];
else return null;
}
alert(getParam( "itemno" ));
//-->
</script>取到值之后显示图片加链接就略了
index:
<input type="button" name="Submit" value="Submit" onclick="window.iframename.setImg(document.getElementById('itemno'))"/>
iframe:
<head>
<SCRIPT LANGUAGE="JavaScript">
function setImg(img){
document.getElementById('itemno').src=img;
}
</SCRIPT>
</head>
<body>
<img src="" id="itemno">
</body>
至于让iframe显示link页面:
<a herf="鏈接的頁面" target="iframename">鏈接</a>
<iframe id="iframe" name="iframename " src=" iframe.html"></iframe>