如何让yelp按钮在新标签页中打开yelp页面?

时间:2015-02-18 05:48:57

标签: html

我的yelp按钮的html代码是:

<div id="yelp-biz-badge-plain-5VrT1XzJPlN0XM5NfZS21g"><a href="http://www.yelp.com/biz/curvesetter-tutoring-los-angeles-2">Check out CurveSetter Tutoring on Yelp</a></div><script type="text/javascript">(function(d, t) {var g = d.createElement(t);var s = d.getElementsByTagName(t)[0];g.id = "yelp-biz-badge-script-plain-5VrT1XzJPlN0XM5NfZS21g";g.src = "//dyn.yelpcdn.com/biz_badge_js/en_US/plain/5VrT1XzJPlN0XM5NfZS21g.js";s.parentNode.insertBefore(g, s);}(document, 'script'));</script>

我尝试添加

target="_blank"

在href和a之前但它仍未在新标签中打开。有什么想法吗? 谢谢!

2 个答案:

答案 0 :(得分:0)

目标=&#34; _blank&#34;将工作。以下代码适用于我。

<div id="yelp-biz-badge-plain-5VrT1XzJPlN0XM5NfZS21g"><a href="http://www.yelp.com/biz/curvesetter-tutoring-los-angeles-2" target="_blank">Check out CurveSetter Tutoring on Yelp</a></div>

working JSFiddle

答案 1 :(得分:0)

target="_blank"如果在 href。

后使用,效果会很好
<a href="http://www.yelp.com/biz/curvesetter-tutoring-los-angeles-2" target="_blank">Check out CurveSetter Tutoring on Yelp</a>