小编use*_*022的帖子

firefox中的svg innerHTML无法显示

我使用innerHTML来添加svg元素,它在chrome中运行良好但在firefox中无法显示; 非常感谢任何能力

    <!DOCTYPE html>
    <html>
    <head>
        <title>SVGInnerHTML demo</title>
        <meta charset="utf-8" />
        <script src="svginnerhtml.js"></script>
        <script>
        alter  = function () {
            var svg = document.getElementById('container');

            svg.innerHTML   = '<rect width="100" height="60" fill="green" />'
                            + '<circle cx="10" cy="19" r="20" fill="blue"></circle>'
                            + '<text x="15" y="20" fill="white">hello world</text>'
                            + '<g transform="translate(0, 70)"><rect width="100" height="20" fill="yellow" /></g>';
        }
        </script>
    </head>

    <body>

    <svg id="container" width="100px" height="100px" http://www.w3.org/2000/svg>

    </svg>

    <p>
    <button onclick="alter()">set .innerHTML</button>
    <button onclick="alert(document.getElementById('container').innerHTML)">get .innerHTML</button>
    </p>
    </body>
    </html>
Run Code Online (Sandbox Code Playgroud)

firefox svg innerhtml

3
推荐指数
1
解决办法
861
查看次数

spring boot多模块包

我正在尝试使用Maven将Spring Boot打包为多个模块,这里是我的主模块pom.xml:

<modules>
    <module>my-data-services</module>
    <module>my-message-services</module>
    <module>my-common</module>
</modules>
<groupId>com.my</groupId>
<artifactId>my-multi-services</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.4.2.RELEASE</version>
</parent>


<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>1.8</java.version>
</properties>
<dependencyManagement>....</dependencyManagement>
<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>
Run Code Online (Sandbox Code Playgroud)

我的常见pom.xml:

<parent>
    <artifactId>my-multi-services</artifactId>
    <groupId>com.my</groupId>
    <version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>my-common</artifactId>
<packaging>jar</packaging>
<dependencies>....</dependencies>
Run Code Online (Sandbox Code Playgroud)

和my-data-services pom.xml:

<parent>
    <artifactId>my-multi-services</artifactId>
    <groupId>com.my</groupId>
    <version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>my-data-services</artifactId>

<dependencies>

    <dependency>
        <groupId>com.my</groupId>
        <artifactId>my-common</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
</dependencies>
Run Code Online (Sandbox Code Playgroud)

my-common模块只是一个常见的utils lib而不是一个可运行的模块,但是当我尝试时mvn clean package,异常抛出如下:

Execution default of goal org.springframework.boot:spring-boot-maven-p
lugin:1.4.2.RELEASE:repackage failed: Unable to find main class 
Run Code Online (Sandbox Code Playgroud)

然后我添加一个主类,这个模块可以打包,但它不是一个lib jar,它就像一个runnable …

spring package maven spring-boot

2
推荐指数
1
解决办法
3489
查看次数

标签 统计

firefox ×1

innerhtml ×1

maven ×1

package ×1

spring ×1

spring-boot ×1

svg ×1