错误:JavaScript嵌入Jekyll中的重复HTML元素
我正面临着嵌入式JavaScript的P5J和目录的嵌入式JavaScript,并在我的Jekyll网站中使用jQuery。 Jekyll呈现2个不同的元素-1个元素是非功能性的,另一个元素的工作原理非常好。
该页面无意间重复JavaScript元素。您可以在网站上查看结果: p5js。和a 图片
我如何从JavaScript中纠正此错误,从而创建两个不同的HTML元素?
源代码在github上,网址为 fallowinenigma
javascript代码在网站上使用:
<script type="text/javascript" src="simple_sketch.js"></script>
渲染 : HTML网站有两个要素:
<div id="simple-sketch-holder">
<script type="text/javascript" src="/assets/posts/p5js/1.js"></script>
<canvas id="defaultCanvas0" style="width: 710px; height: 400px;" width="710" height="400"></canvas><canvas id="defaultCanvas1" style="width: 710px; height: 400px;" width="710" height="400"></canvas></div>
I am facing issues with embedded JavaScript for p5js and Table of Contents using jQuery in my Jekyll site. Jekyll renders 2 different elements - 1 element is non-functional and the other element works perfectly fine.
The page is unintentionally duplicating the JavaScript element. You can view the results on the site: P5js. and a picture
How do I correct this error from JavaScript creating two different HTML elements?
The source code is on GitHub at Fallinginenigma
JavaScript code being use on the site:
<script type="text/javascript" src="simple_sketch.js"></script>
The rendered HTML site has two elements:
<div id="simple-sketch-holder">
<script type="text/javascript" src="/assets/posts/p5js/1.js"></script>
<canvas id="defaultCanvas0" style="width: 710px; height: 400px;" width="710" height="400"></canvas><canvas id="defaultCanvas1" style="width: 710px; height: 400px;" width="710" height="400"></canvas></div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论