1、带参数打开新窗口
2、获取参数
var afterUrl = window.location.search.substring(1);(问号以后的字符串)
var afterEqual = afterUrl.substring(afterUrl.indexof('=')+1).toUpperCase();(等号以后的字符串,及你所要的参数)
--------------------------------------------------------------------------
传参二
- <table>
- <tr align="left">
- <td colspan="5">
- <a href="javascript:openwindow()">填写你的邮寄地址</a>
- 区: <input type="text" size="10" name="district" disabled />
- 街道:<input type="text" size="10" name="street" disabled />
- </td>
- </tr>
- </table>
接收:
- <script type="text/javascript">
- function closewindow(){
- //opener可以获取、设置通过window.open()打开此页面的父页面的值
- opener.document.myform.district.value = document.myform.district.value;
- opener.document.myform.street.value = document.myform.street.value;
- window.close();
- }
- </script>