当有人单击我页面上的任何链接时,打开两个选项卡

时间:2018-12-02 01:00:06

标签: javascript html

JavaScript-当有人点击我页面上的任何链接时,需要打开两个标签。

当涉及到这些东西时,我是一个全新的人,但是我了解其中的大部分,我只是出于某种原因而无法亲自撰写。有没有人可以帮助我?我已经查看了此处打开的两个链接部分,但是它们都没有帮助。我想要做的基本上是当有人单击我的网站上的任何链接时创建一个“秘密页面”。因此,我的“谢谢页面”上有一些按钮和图片,当有人单击任何一个链接或图片,在新窗口中打开一个新标签,在完全相同的感谢页面上打开另一个页面。任何帮助将不胜感激。提前谢谢大家!

1 个答案:

答案 0 :(得分:0)

据我所知,您可以将事件处理函数附加到链接上

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>rx7.electrical.system</groupId>
    <artifactId>oces</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>oces</name>
    <description>Rx7 Onboard Computer Electrical System</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.0.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web-services</artifactId>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.jfoenix/jfoenix -->
        <dependency>
            <groupId>com.jfoenix</groupId>
            <artifactId>jfoenix</artifactId>
            <version>8.0.7</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/de.jensd/fontawesomefx -->
        <dependency>
            <groupId>de.jensd</groupId>
            <artifactId>fontawesomefx</artifactId>
            <version>8.9</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.openjfx/javafx-base -->
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-base</artifactId>
            <version>12-ea+3</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.javafxports/armv6hf-sdk -->
        <dependency>
            <groupId>org.javafxports</groupId>
            <artifactId>armv6hf-sdk</artifactId>
            <version>8.60.11</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <executable>true</executable>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <mainClass>rx7.onboard.computer.electrical.system.main.App</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

第一行将打开一个新标签,第二行会将当前页面重定向到其他URL