我有这个网址:
<a rel="external nofollow" href="http://prf.hn/click/camref:1101l337I/creativeref:1101l14808/destination:https://www.wehkamp.nl/Winkelen/KenmerkAdviseurArtikel.aspx?CC=C50&SC=IUB&KAC=C76&artikelNummer=766344&MaatCode=0000&BC=PHGBaby_766344&utm_campaign=affiliates_productfeed_Fiets_Baby&dfw_tracker=22685-86766344" onclick="goog_report_conversion ('http://prf.hn/click/camref:1101l337I/creativeref:1101l14808/destination:https://www.wehkamp.nl/Winkelen/KenmerkAdviseurArtikel.aspx?CC=C50&SC=IUB&KAC=C76&artikelNummer=766344&MaatCode=0000&BC=PHGBaby_766344&utm_campaign=affiliates_productfeed_Fiets_Baby&dfw_tracker=22685-86766344');productclick(3374956,'85-86766344');return true;" target="_blank" class="btn-primary-green" style="font-size:14px;">Shop now <i class="fa fa-chevron-right"></i></a>
当我单击此链接时,它会在新选项卡中打开,但同时也会在现有选项卡中打开。
当我删除 onclick 属性时,如下所示,它工作正常:
<a rel="external nofollow" href="http://prf.hn/click/camref:1101l337I/creativeref:1101l14808/destination:https://www.wehkamp.nl/Winkelen/KenmerkAdviseurArtikel.aspx?CC=C50&SC=IUB&KAC=C76&artikelNummer=766344&MaatCode=0000&BC=PHGBaby_766344&utm_campaign=affiliates_productfeed_Fiets_Baby&dfw_tracker=22685-86766344" target="_blank" class="btn-primary-green" style="font-size:14px;">Shop now <i class="fa fa-chevron-right"></i></a>
productclick
我尝试在 onclick 事件中删除该功能,问题仍然存在。但是当我删除goog_report_conversion
并将该productclick
功能保留在onclick中时,问题就消失了。看来问题确实与goog_report_conversion
通话有关。我在控制台或网络选项卡中没有收到任何错误。
我还尝试完全删除 onclick 事件并在 jQuery onclick 事件中运行 onclick 代码,但即便如此,链接也会在同一个选项卡和一个新选项卡中打开。
如何确保链接不会在当前选项卡中打开?