簡體   English   中英

在新視窗或分頁中開啟

[英]Open in new window or tab

我想在新窗口或標簽中打開以下內容。 當前,它在同一窗口中打開,因此在發送電子郵件之后,必須重新加載頁面。 這是此網頁的一部分

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;
   }
}

使用window.open

您只需要以下代碼即可在新窗口中打開頁面,請嘗試此操作

window.open(url, '_blank');

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM