我有一个的onClick提交按钮:window.location的()不工作,不开放
<div id="messageDiv">
<form>
<textarea name="message" rows="10" cols="20"></textarea></textarea>
<br /><br />
<input type="submit" value="Send" onClick="sendmail()">
<input type="reset" value="Reset" name='reset'>
</form>
</div>
然后我有我的sendmail:
function sendmail()
{
window.location.href = "http://www.rainbowcode.net/index.php/profiles/mail?="+mailid;
window.location('http://www.rainbowcode.net/index.php/profiles/mail?='+mailid);
//return true;
}
mailid
是一个全局变量,得到在另一个JS函数中设置,它确实包含正确的值。 window.location
怎么没有打开我的页面?
如果我手动与它的工作原理罚款mailid ..打开它
你为什么要将location.href和调用位置设置为一个函数? – Nathan 2011-05-23 07:32:01
我不明白? – 2011-05-23 07:34:41
不是'window.location ='http://stackoverflow.com/';'工作..? – Marty 2011-05-23 07:35:54