简体   繁体   English

如何在一个链接中执行两个事件<a href..>:在 onClick</a>事件中<a href..>到外部页面 (_blank) 和内部页面 (_self)?</a>

[英]How to do two events in one link <a href..>: to external page (_blank) and to internal page (_self) in event onClick?

I have a link on site: <a href="https://paypal.com/..." title="Pay now on PayPal"...>Pay now</a> .我在网站上有一个链接: <a href="https://paypal.com/..." title="Pay now on PayPal"...>Pay now</a> Needs to do next actions:需要做的下一步操作:

  1. open onClick in new tab external page of PayPal (invoice),在 PayPal(发票)的新标签外部页面中打开 onClick,
  2. open onClick in this tab internal page of next text about confirmation of payment.在此选项卡内部页面中打开有关付款确认的下一个文本的 onClick。

Think its about using event(s) onClick in <a href="#" onClick="...">Pay now</a> , but I can`t find working example of this task.考虑在<a href="#" onClick="...">Pay now</a>使用 onClick 事件,但我找不到此任务的工作示例。 Please, help in this question to do working button.请帮助解决这个问题以完成工作按钮。

Call this function on your button click:单击按钮时调用此函数:

function onClick() { 
   window.open("https://www.google.com", "_blank"); 
   window.location.href = "https://www.facebook.com";
} 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM