关于Window.open [总结]
来源:互联网 发布:mac wifi未安装硬件 编辑:程序博客网 时间:2024/06/13 19:04
此为工作中总结出的。
于父页面oc1栏位输入值,当失去焦点时打开自页面。于子页面中连接数据库查询其他相关信息,然后传值回父页面。此为达到一个数据中转的功能。其他,如:验证,传值等可于同等方法下改写即可。(已通过测试)
父页面
<input type="text" name="oc1" onblur = "openwindow();">
<input type="text" name="oc2">
<input type="text" name="oc3">
<input type="text" name="oc4">
<input type="text" name="oc5">
<script language="javascript">
function openwindow()
{
var c1 = document.getElementById("oc1").value;
var URL = "new.asp?LotID=" + escape(c1);
window.open(URL,'New_window','height=100; width=200; resizable=0; scrollbars=0; toolbar=0;top=0;left=0;status=0');
}
</script>
标注:escape()为把其中参数转换成为Unicoal型别
子页面
<HTML><BODY>读取中(Retrieve Data)...</font>
<SCRIPT LANGUAGE="VBScript">
Dim con,sSQL
<%
LotID = Request("LotID") '取出主表单所传过来的值
'连接数据库
Set con = Server.Createobject("ADODB.Connection")
con.Open("Driver={SQL Server};Server=数据服务器地址;UID=用户名;PWD=密码;Database=数据库名称")
set rs=server.createobject("ADODB.Recordset")
sql="select prod_id,lottype,qty,priority from NonProdBankInOutLotInfo_v where lot_id='" & LotID & "'" '查询所需数据
rs.open sql,con,3,1
if not rs.eof then
%>
opener.document.getElementById("oC2").value = "<%=rs("lottype")%>"
opener.document.getElementById("oc3").value = "<%=rs("prod_id")%>"
opener.document.getElementById("oc4").value = "<%=rs("priority")%>"
opener.document.getElementById("oc5").value = "<%=rs("qty")%>"
<%
set rs = Nothing
con.close
set con=Nothing
else
%>
msgbox "Invalid LotID, please try again!"
<%
end if
%>
self.close
</SCRIPT>
</BODY></HTML>
- 关于Window.open [总结]
- window.open()总结
- window.open参数总结
- window.open()用法总结
- window.open()用法总结
- window.open 使用方法总结
- window.open总结
- Window.open使用总结
- iframe总结 + window.open
- JavaScript关于window.open()应用
- JavaScript关于window.open()应用
- JavaScript关于window.open()应用
- 关于IE8 window.open问题
- 关于window.open的问题
- 关于window.open()和window.openner()
- window.open的使用方法总结
- JavaScript关于window.open()应用(转)
- 关于Window.open的参数小结
- VS.NET打印思想与2003/5DataGrid、DataGridView及二维数据如ListView等终极打印实现
- ajax是否存在潜在危险
- 使用Excel“自动化”功能将数据输出到Excel的三种高效方法对比实验
- 我的股票:2007/06/18 净值:不变
- 是什么I18N/L10N ?
- 关于Window.open [总结]
- How to activate snap group account on Symbian 9.x upwards platform
- 牛人的七年IT奋斗纪实及感悟【转载】
- asp横向循环的问题
- 工作3个月纪念
- In-place editing of ListView subitems
- Shrink SQL Server Log Files
- 表中的两个字段拼接到一起,做为查询条件
- LINUX下获取IP地址和MAC地址