window.top.frames["w_right"].document.getElementById('id').value=request("sendid");
解决方案 »
- 新新新新手请教简单网页代码问题
- 新手问题,为何在自机上写普通一句javascrip代码运行都会有安全警告,而看新浪都没有提示警告
- 为什么我的右键菜单不能正确显示
- xmlhttp在网速慢的情况下为何执行效率低?
- Ext.view.View使用TPL问题
- 如何对本脚本设置,让树型菜单在网页开启时就完全展开.(有tree_maker.js文件支持,如需查看请回复)
- 如何取得属性符合特定条件的html元素集合??
- 菜鸟提问,在线等待
- 天,,VML问题,我只是想画个1/4扇型,干什么MS的VML和W3C的说明文档货不对版呢?
- 如何后退到自己所要要的网页
- javascript控制复选框的选择个数?
- 小小鸟的疑惑(js函数理解)
send.html:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> a.html </TITLE>
</HEAD>
<script language="javascript">
function writeCookie(s){document.cookie="a="+s+";"}
</script>
<BODY><form method=post action='b.htm'>
<input TYPE="text" id="sendid" name="sendid" SIZE="10" maxlength="10">
<input type=submit value='tj' onclick="javascript:writeCookie(document.getElementById('sendid').value)">
</form>
</BODY>
</HTML>
login.htm:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title></title>
<script language="javascript">function getSendID(s){
var c = document.cookie;
var start = c.indexOf(s + "=");
if (start== -1){alert("cookies not found");return;}
start=c.indexOf("=",start)+1;
var end = c.indexOf(";",start);
if (end==-1){end=c.length;}
if (c.substring(start,end)==null) {alert("No cookies found!");return;}
document.getElementById('recvid').value=c.substring(start,end);
}
</script>
</head>
<body onload='getSendID("a");'>
<input ID="recvid" NAME="id" TYPE="text" SIZE="10" maxlength="10">
</body>
</html>
HTTP 错误 405 - 用于访问该页的 HTTP 动作未被许可可能是html页面不支持动态的脚本?
接着用3楼的方法来试...
function writeCookie(s){
document.cookie="a="+s+";";
location.href='b.htm'; //这里跳转
}
</script><input TYPE="text" id="sendid" name="sendid" SIZE="10" maxlength="10">
<input type=button value='tj' onclick="javascript:writeCookie(document.getElementById('sendid').value)">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<form action="frame_login.html" method="get">
<input NAME="sendid" TYPE="text" SIZE="10" maxlength="10" value="aaa">
<input type="submit" value="submit">
</form>
</body>
</html>frame_login.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<script>
window.onload = function(){
var s1 = window.location.href.match(/sendid=.*?$/g);
var val = "";
if (!s1 || !s1[0]) {
return;
}
var s2 = s1[0].match(/[^\=]*$/g);
if (!s2 || !s2[0]) {
return;
}
var val = decodeURI(s2[0]);
window.frames["w_right"].document.getElementById("text1").value = val;
}
</script>
<frameset rows="50%,*">
<frame name="w_right" src="login.html" scrolling="auto" resize>
</frameset>
</html>
login.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<h1>login.html</h1>
<input type="text" id="text1" value="">
</body>
</html>