我想在新窗口或标签中打开以下内容。目前它在同一窗口中打开,以便在发送电子邮件后,必须重新加载页面。这是this webpage
的一部分function email_message()
{
bodytext = document.getElementById("end").value;
if (bodytext.length > 1850)
{
alert("Oops! The E-Mail Someone button can only be used for short messages, 3 or less lines of message text. \nYou can always copy the Encoded Message and past into your regular email!")
return;
}
who_to = prompt("Enter recipient's email address: ","anybody@anywhere.com");
s_line = "Encoded Message";
var confirm_send = confirm("Send Email?");
if (confirm_send == true)
{
parent.location.href = 'mailto:' + who_to + '?subject=' + s_line + '&body=' + "Decode at www.mysite.com/myhtml.htm%0D%0D" + bodytext;
}
else
{
return;
}
}
答案 0 :(得分:1)
使用window.open
您只需要下面的代码在新窗口中打开页面,试过这个
window.open(url, '_blank');