手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >js 点击按钮弹出另一页,选择值后,返回到当前页
js 点击按钮弹出另一页,选择值后,返回到当前页
摘要:1。效果图:2。主页面的代码:复制代码代码如下:functionopen_windows_and_get_selectedinfo(open...

1。 效果图:

js 点击按钮弹出另一页,选择值后,返回到当前页1

2。 主页面的代码:

复制代码 代码如下:

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

<title></title>

<script type="text/javascript">

function open_windows_and_get_selectedinfo(openwindow, control, control2) {

var str = window.showModalDialog(openwindow, window, "dialogWidth=740px;dialogHeight=600px;center=yes;help=no;resizable=no;status=no");

if (!str)

return;

document.getElementById(control).value = str[0];

document.getElementById(control2).value = str[1];

}

</script>

</head>

<body>

<form id="form1" runat="server">

<div id="autosuggest"><ul></ul></div>

<div>

<input id="txtActive" runat="server" readonly="readonly" />

<input type="button" id="selectActive" runat="server" value="..." />

<asp:HiddenField ID="hfActive" runat="server" />

</div>

</form>

</body>

</html>

3。 弹出页面的代码:

复制代码 代码如下:

<html xmlns="http://www.w3.org/1999/xhtml">

<base target="_self">

<head runat="server">

<title></title>

<script type="text/javascript" language="javascript">

function dbclick_return_and_close(strid, strvalue) {

alert("执行该方法!");

var str = new Array(strid, strvalue);

window.returnValue = str;

window.close();

}

</script>

</head>

<body>

<form id="form1" runat="server">

<div>

<a href="#">点击这一行,带值返回到原页面</a>

</div>

</form>

</body>

</html>

【js 点击按钮弹出另一页,选择值后,返回到当前页】相关文章:

javascript字符串与数组转换汇总

javascript实现点击按钮弹出一个可关闭层窗口同时网页背景变灰的方法

JavaScript中String.prototype用法

JS中字符串trim()使用示例

js实现点击链接后延迟3秒再跳转的方法

些很实用且必用的小脚本代码

静态的动态续篇之来点XML

网页常用Javascript

实现placeholder效果的方案汇总

JavaScript中的blink()方法的使用

精品推荐
分类导航