例如:
<input type="text" name="hello" id="hello"/>&&你好
<a href="#" onclick="onformopen('')">Email</a>
<script language="javascript">
function onformopen(){
var hello = document.getElementById("hello").value;
var other = document.getElementById("other").value;
var url = "hello.html?other="+other+"&hello="+hello;
atenaKensakuWin = window.open(url);
}
</script> 我需要传的不只这2个 而且只能用这种办法解决问题 (我自己也很讨厌这需求)哪个哥哥 帮帮我啊 要怎么做 才能把&这个字符处理成地址不理解的关键字啊
<input type="text" name="hello" id="hello"/>&&你好
<a href="#" onclick="onformopen('')">Email</a>
<script language="javascript">
function onformopen(){
var hello = document.getElementById("hello").value;
var other = document.getElementById("other").value;
var url = "hello.html?other="+other+"&hello="+hello;
atenaKensakuWin = window.open(url);
}
</script> 我需要传的不只这2个 而且只能用这种办法解决问题 (我自己也很讨厌这需求)哪个哥哥 帮帮我啊 要怎么做 才能把&这个字符处理成地址不理解的关键字啊
var url = "hello.html?other="+escape(other)+"&hello="+escape(hello);
var url = "hello.html?other="+other+"&hello="+hello;
<form name="form1" method="get" action="hello.html" target="_blank">
<input type="text" name="hello">
</form>
没有显示的参数用hidden
调用document.form1.submit();方法二:
用escape()之类的js方法对value编码
在hello.html中再用unescape()解码