Posted on 2012-02-19 12:56
哈希 阅读(172)
评论(0) 编辑 收藏 所属分类:
Js and Jquery 常用总结
ask.jsp
<script language="javascript" type="text/javascript">
function Open()
{
window.open('<%=path%>/jsp/answer.jsp' ,'_blank','top=250,left=300,width=500 height=100');
}
</script>
<body>
<form onsubmit= "return new_window(); " >
<input type="text" name="tbValue"><a href="javascript:" onclick="Open();">Open http://www.dwww.cn </a>
</form>
</body>
answer.jsp
<script language="javascript" type="text/javascript">
function SetValue(value)
{
self.opener.document.all("tbValue").value=value;
self.close();
}
</script>
<body>
Values:<br/>
<a href="javascript:SetValue('1')">value 1</a><br/>
<a href="javascript:SetValue('2')">value 2</a>
</body>