我刚刚拿到了typed.js,在让<body>被打印出来方面遇到了一些困难,所以在网站上,<body>说。每当我试着运行它,它就会结冰。当字符串更改为body而不是<body>时,我的代码才能工作。
<span class="typed"></span>JS
$(function(){
$(".typed").typed({
strings: ["<body>"],
typeSpeed: 100
});
});发布于 2017-07-15 15:56:48
使用<和>转义<和>
$(function() {
$(".typed").typed({
strings: ["<body>"],
typeSpeed: 100
});
});<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/typed.js/1.1.7/typed.min.js"></script>
<span class="typed"></span>
https://stackoverflow.com/questions/45120023
复制相似问题