0

想使用 window.open() 将电子邮件地址作为附加到 url 的参数传递,但我挂断了。这就是返回的内容

http://app.gogodriver.com/SignupPage.php?email=[object%20HTMLInputElement]

功能:

function open_app(tryitemail)
{
    window.open("http://app.gogodriver.com/SignupPage.php?email="+tryitemail, "_blank","width=450, height=650");    
}

HTML:

<form id="tryitfree">                                       
    <input class="input" type="text" name="tryitemail" placeholder="Email" size="25" />
    <input type="image" src="images/go-button.png" id="TryItButton" value="email" onClick="open_app(tryitemail)">
</form>
4

1 回答 1

0

这是因为您发送的是输入元素,而不是它的值。你应该做这个:

<input type="image" src="images/go-button.png" id="TryItButton" value="email" onClick="open_app(tryitemail.value)">
于 2012-06-18T20:34:20.860 回答