springboot怎么把数据传给前端:springboot 如何引入前端 bootstrap?
这种问题网上一搜一大堆,你可以具体找一篇文章试试,遇到问题可以针对相关问题去提问。springboot通过jar包方式引入bootstrap_个人文章 - SegmentFault 思否 这不是查查就
顺晟科技
2022-10-19 13:04:16
221
在我的应用程序中,我有我的javascript文件。我正在尝试将这些文件转换为javascript模块。
我需要在html中包含一些代码(为了生成Django URL-(请参见此问题How to configure a Django url,在JavaScript中正确配置)。
HTML
<html>
<head>
</head>
<body>
<p id="display_text">aaa</p>
</body>
<script type="">
function setText(text) {
var display_text = document.getElementById('display_text');
display_text.innerText = text;
}
</script>
<script type="" src="module.js"></script>
</html>
module.js
<html>
<head>
</head>
<body>
<p id="display_text">aaa</p>
</body>
<script type="">
function setText(text) {
var display_text = document.getElementById('display_text');
display_text.innerText = text;
}
</script>
<script type="" src="module.js"></script>
</html>
这似乎不适用于模块
如果按以下方式转换html
<html>
<head>
</head>
<body>
<p id="display_text">aaa</p>
</body>
<script type="">
function setText(text) {
var display_text = document.getElementById('display_text');
display_text.innerText = text;
}
</script>
<script type="" src="module.js"></script>
</html>
我得到错误
module.js:1未捕获的引用Error:未定义setText
如果需要将settext函数导入到module.js中,如何操作?
我做错了什么?
顺晟科技:
05
2022-12
02
2022-12
02
2022-12
29
2022-11
29
2022-11
24
2022-11