springboot怎么把数据传给前端:springboot 如何引入前端 bootstrap?
这种问题网上一搜一大堆,你可以具体找一篇文章试试,遇到问题可以针对相关问题去提问。springboot通过jar包方式引入bootstrap_个人文章 - SegmentFault 思否 这不是查查就
顺晟科技
2022-10-18 13:28:07
84
前几天我在做一个使用jQuery 3.6.0的项目,但我发现它不能解析<template>
标记.
请参考下面的示例。
const temp = $("#main");
console.log(temp.find("div").html()); // this isn't working
const temp2 = $("#main2");
console.log(temp2.find("div").html()); // this is working
<代码><;script SRC=“ https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js ”>;<;/script>;<;模板ID=“ main ”>;<;DIV类=“第一”>;<;span>;你好<;/span>;<;/DIV>;<;/模板>;<;DIV ID=“ main2 ” style=“ display:none;”>;<;DIV类=“第一”>;<;span>;你好<;/span>;<;/DIV>;<;/DIV>;我做错了
什么?
顺晟科技:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<template id="main">
<div class="first">
<span>Hola</span>
</div>
</template>
<div id="main2" style="display:none;">
<div class="first">
<span>Hola</span>
</div>
</div>
将生成一个文档片段,其中<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<template id="main">
<div class="first">
<span>Hola</span>
</div>
</template>
<div id="main2" style="display:none;">
<div class="first">
<span>Hola</span>
</div>
</div>
元素的内容是。您必须使用template
访问它。
所以你可以做的是<template>
但是您需要注意mdn:$(temp[0].content).find('div').html()
:内容模板元素:
但是,HtmlTemplateElement有一个template
属性,该属性是一个只读的DocumentFragment,其中包含模板所表示的DOM子树。请注意,直接使用内容的值可能会导致意外行为,请参阅下面的“避免DocumentFragment陷阱”部分。
content
<代码><;script SRC=“ https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js ”>;<;/script>;<;模板ID=“ main ”>;<;DIV类=“第一”>;<;span>;你好<;/span>;<;/DIV>;<;/模板>;<;DIV ID=“ main2 ” style=“ display:none;”>;<;DIV类=“第一”>;<;span>;你好<;/span>;<;/DIV>;<;/DIV>;
05
2022-12
02
2022-12
02
2022-12
29
2022-11
29
2022-11
24
2022-11