如何通过单击页面打开多个URL?

时间:2018-07-17 22:31:30

标签: javascript html popup ads

一旦有人访问我的网站,我就有一个代码可在新标签页中打开链接。就像是将其带到另一个网站的弹出窗口。

我想更改代码,以便它打开多个URL,而不仅仅是一个。这是我现在拥有的:

<script><!--loc can be any changed to your window-->
var loc = "https://google.com/";
window.onclick = function() {
   window.open(loc);
}
</script>

1 个答案:

答案 0 :(得分:1)

您可以尝试执行以下操作来实现此目的:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml"  indent="yes"/>

    <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>

    <xsl:template match="/"> 
        <Root> 
            <xsl:apply-templates/>
        </Root>
    </xsl:template>

    <xsl:template match="p">
        <xsl:copy><xsl:apply-templates select="@*|node()" /></xsl:copy>
        <xsl:text>&#13;</xsl:text> 
    </xsl:template>

</xsl:stylesheet>