我需要在新标签页中打开以下代码。该链接指向一个由" Occupation Link 1"指定的网站。
{block:ifOccupation1}
<a {block:ifOccupationlink1}onclick="window.location.href='{text:Occupation Link 1}'" style="cursor:pointer"{/block:ifOccupationlink1}>
{text:Occupation 1}
</a>
{/block:ifOccupation1}
答案 0 :(得分:1)
将?target=_blank
添加到网址末尾:
{block:ifOccupation1}
<a {block:ifOccupationlink1}onclick="window.location.href='{text:Occupation Link 1}'" target='_blank' style="cursor:pointer"{/block:ifOccupationlink1}>
{text:Occupation 1}
</a>
{/block:ifOccupation1}
答案 1 :(得分:1)
要在新标签中打开链接,您只需在锚标记中添加一个目标,即target =“_ blank”。这个'_blank'实际上在新标签页中打开了所需的链接。
**<a {block:ifOccupationlink1}onclick="window.location.href='{text:Occupation Link 1}'" target="_blank" style="cursor:pointer"{/block:ifOccupationlink1}>
{text:Occupation 1}
</a>**