子窗口和父窗口的交互问题,希望大家帮助 加上这句window.opener.document.getElementById('username').value=printhtml;就OK了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <script language="javascript"> function to_to(s){ var printhtml = ""; printhtml += " <form name='f' action='test.php' method='POST'>"; printhtml += " <input type='text' id='username' name='username' value='" + s + "'>"; printhtml += " <input type='submit'>"; printhtml += " </form>"; opener.document.getElementById("msg").innerHTML = printhtml;}</script><a href=# onclick="to_to('要输入的文字')">check</a> 那同时在printhtml中的username文本框输入文字,如何解决呀? <script language="javascript"> function to_to(){ var printhtml = " <html>body>"; printhtml += " <form name='f' action='test.php' method='POST'>"; printhtml += " <input type='text' id='username' name='username'>"; printhtml += " <input type='submit'>"; printhtml += " </form>"; printhtml += " </body> </html>"; window.opener.document.getElementById('msg').innerText=printhtml; window.opener.document.getElementById('username').value="输入名称";} </script> window.opener.document.getElementById('msg').innerText=printhtml; 换成window.opener.document.getElementById("msg").innerHTML = printhtml; 带有html的 在Android上通过手机GPS来获取当前位置的经纬度的方法? 小白请教:jquery 实现表格排序 Jquery 光标移动input 为空改变按钮内容问题 js 脚本错误 struts中难道不能获得用javascript设置的hidden值? 如何计算出窗口的大小? 关于prototype的奇怪问题 高手救命啊!!!!关于在可编辑的状态中的定位问题 让div标记里面的内容滚动,但却不知道怎么让它停下来(就像CSDN的效果).就是,内容滚动完后,再双击就失效了. return false应用问题 javaScript 通过域名解析成IP地址,我只能通过JavaScript和html来实现
function to_to(s){
var printhtml = "";
printhtml += " <form name='f' action='test.php' method='POST'>";
printhtml += " <input type='text' id='username' name='username' value='" + s + "'>";
printhtml += " <input type='submit'>";
printhtml += " </form>";
opener.document.getElementById("msg").innerHTML = printhtml;
}
</script>
<a href=# onclick="to_to('要输入的文字')">check</a>
<script language="javascript">
function to_to(){ var printhtml = " <html>body>";
printhtml += " <form name='f' action='test.php' method='POST'>";
printhtml += " <input type='text' id='username' name='username'>";
printhtml += " <input type='submit'>";
printhtml += " </form>";
printhtml += " </body> </html>";
window.opener.document.getElementById('msg').innerText=printhtml; window.opener.document.getElementById('username').value="输入名称";
}
</script>
换成window.opener.document.getElementById("msg").innerHTML = printhtml; 带有html的