大侠,帮忙:如何实现点击一个超链接,将一个值传递到两个不同的新页面中?

almser 2001-05-30 09:05:00
大侠,帮忙:如何实现点击一个超链接,将一个值传递到两个不同的新页面中?我要可用的代码,谢谢!
...全文
138 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
almser 2001-05-31
  • 打赏
  • 举报
回复
BrentIvan(Ivan)提到的JavaScript: window.open('target2.asp'),其中的window.open用法对我很有用,我查了javascript的参考书,马上解决我的问题,在此感谢各位同胞,感激涕零,特将20分奉送各位,以后请多多光照!!!!
wubin_wb 2001-05-30
  • 打赏
  • 举报
回复
看看下面这个例子,不知是否有帮助:
<HTML>
<HEAD>
<TITLE>Window Manger</TITLE>
<LINK REL="stylesheet" HREF="../samples.css" TYPE="text/css">
<SCRIPT LANGUAGE="JavaScript">
// Create an array to hold references to the child windows.
/* Each member of this array will be a window object created
using the createWindow method below. */
var windows = new Array();

function newWindow(url, wname) {
// Constructor for the window.
/* This function should be called only by the createWindow
function below. */
var features = "";
if (null != arguments[2])
features = arguments[2];
return window.open(url, wname, features);
}

function createWindow(url, wname) {
// Add a window to the windows collection.
var features = arguments[2] == null ? "" : arguments[2];
windows[wname] = new newWindow(url, wname, features);
}

function closeWindows() {
// Close all the windows opened by addWindow.
/* To close an individual window,
its close method is called. */
/* This function should be called during the onunload
event to automatically close all open windows. */
for (w in windows)
if (!windows[w].closed)
windows[w].close();
}

/* The following two functions demonstrate using the
createWindow and closeWindows methods. */

function listWindows() {
// List the windows and their current states.
var swin = "Window List\n";
for (w in windows)
swin += w + ":" +
((windows[w].closed) ? "Closed" : "Open") + "\n";
alert(swin);
}

function openSampleWindows() {
// Open two windows.
createWindow("closeme.htm", "ChildWindow1");
createWindow("closeme.htm", "ChildWindow2");
}
</SCRIPT>
</HEAD>
<BODY ONUNLOAD="closeWindows();">
<H1>Window Manager</H1>
<FORM>
<INPUT TYPE=BUTTON ONCLICK="openSampleWindows();"
VALUE="Add Windows">
<INPUT TYPE=BUTTON ONCLICK="listWindows();"
VALUE="List Windows">
<INPUT TYPE=BUTTON ONCLICK="closeWindows();"
VALUE="Close Windows">
</FORM>
</BODY>
</HTML>
kenspc 2001-05-30
  • 打赏
  • 举报
回复
先不管你提交于什么网页,你可以使用以下方法
<a href="#" onclick="self.location.href='target1.html?var1=abc'">
转了一值abc名为var1的变数
BrentIvan 2001-05-30
  • 打赏
  • 举报
回复
可以提交到两个frame或者两个窗口
<a href="target1.asp" onclick="JavaScript: window.open('target2.asp')">two target</a>
kenspc 2001-05-30
  • 打赏
  • 举报
回复
您说的两个新页面不同的窗口吗?

28,408

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧