<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function buy(){
alert("aaa");
//var bno=document.getElementById("bno").value;
//alert(bno);
var bid=987;
window.location.href = 'http://localhost:8080/ddln/login.jsp?px=123&bid=455';
}
</script>
</head>
<body>
<input type="text" name="bno" id="bno" size="1" value="1"/> <a href="#" onclick="buy();">购买</a>
</html>
效果图如下:
方法2:
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function buy(){
alert("aaa");
var bno=document.getElementById("bno").value;
var bno2=document.getElementById("bno2").value;
alert(bno+" "+bno2);
window.location.href = 'http://localhost:8080/ddln/login.jsp?px='+bno+'&id='+bno2;
}
</script>
</head>
<body>
<input type="text" name="bno" id="bno" size="1" value="1"/>
<input type="text" name="bno2" id="bno2" size="1" value="2"/>
<a href="#" onclick="buy();">购买</a>
</html>