springboot怎么把数据传给前端:springboot 如何引入前端 bootstrap?
这种问题网上一搜一大堆,你可以具体找一篇文章试试,遇到问题可以针对相关问题去提问。springboot通过jar包方式引入bootstrap_个人文章 - SegmentFault 思否 这不是查查就
顺晟科技
2022-10-19 12:27:26
77
我的代码只是显示我与php文件一起包含的php文件,所以当标签页加载时,它已经加载了数据。
所以在将数据插入数据库后,它仍然有旧数据来获取当前数据,我需要重新加载整个页面来获取新数据。
所以每次过程完成后,我都必须重新加载整个页面。
##这是我需要的##
2.如果我只重新加载选定的标签页,那么我将在提交数据后获得新数据
##描述##
顺晟科技:
为什么不使用jQuery而不是php呢?它可以满足您的需要,而且非常简单。
例如:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {box-sizing: border-box}
body {font-family: "Lato", sans-serif;}
/* Style the tab */
.tab {
float: left;
border: 1px solid #ccc;
background-color: #f1f1f1;
width: 30%;
height: 300px;
}
/* Style the buttons inside the tab */
.tab button {
display: block;
background-color: inherit;
color: black;
padding: 22px 16px;
width: 100%;
border: none;
outline: none;
text-align: left;
cursor: pointer;
transition: 0.3s;
font-size: 17px;
}
/* Change background color of buttons on hover */
.tab button:hover {
background-color: #ddd;
}
/* Create an active/current "tab button" class */
.tab button.active {
background-color: #ccc;
}
/* Style the tab content */
.tabcontent {
float: left;
padding: 0px 12px;
border: 1px solid #ccc;
width: 70%;
border-left: none;
height: 300px;
}
</style>
</head>
<body>
<h2>Vertical Tabs</h2>
<p>This is code i am diplaying included php file which contains process of inserting ,deleting and updating</p>
<p>Currently after data submission or update i have to reload whole page to get current data for three tabs </p>
<p>I need to know how to refresh the selected tab php file to get the current data for selected tab witout reloading page</p>
<p>for example: after i insert data in insert tab after i select update tab it should load and show current data instead of showing old data</p>
<div class="tab">
<button class="tablinks" onclick="openCity(event, 'London')" id="defaultOpen">insert</button>
<button class="tablinks" onclick="openCity(event, 'Paris')">update</button>
<button class="tablinks" onclick="openCity(event, 'Tokyo')">delete</button>
</div>
<div id="London" class="tabcontent">
<h3>insert</h3>
<p>here will be my first php includes</p>
<?php
include "insert.php"; ?>
</div>
<div id="Paris" class="tabcontent">
<h3>update</h3>
<p>here will be my second php includes</p>
<?php
include "update.php"; ?>
</div>
<div id="Tokyo" class="tabcontent">
<h3>delete</h3>
<p>here will be my third php includes</p>
<?php
include "delete.php"; ?>
</div>
<script>
function openCity(evt, cityName) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
document.getElementById(cityName).style.display = "block";
evt.currentTarget.className += " active";
}
// Get the element with id="defaultOpen" and click on it
document.getElementById("defaultOpen").click();
</script>
</body>
</html>
您可以用它做很多事情,比如
05
2022-12
02
2022-12
02
2022-12
29
2022-11
29
2022-11
24
2022-11