首页 > 解决方案 > 如何在 JSP 中将值传递给 html?

问题描述

我试图将值,lottie json url 传递给 html。但它不起作用。但是当我直接在html“src”中写lottie url时,它可以工作。这段代码有什么问题?先感谢您

[js文件]

test : function () {
$("#lottie1").attr('src', "https://assets5.lottiefiles.com/datafiles/zc3XRzudyWE36ZBJr7PIkkqq0PFIrIBgp4ojqShI/newAnimation.json")
}

[html文件]

<td width="300" height="200">
<lottie-player id="lottie1" src="" background="transparent" style="width: 300px; height: 225px;" speed="1" loop autoplay>
</lottie-player>
</td>

标签: htmlajaxjsp

解决方案


推荐阅读