用其他PHP文件中指定的HTML表填充DIV容器
我需要如何更改用其他PHP文件中指定的HTML表填充DIV容器,php,jquery,html-table,Php,Jquery,Html Table,我需要如何更改loadPopupManual(),才能用content.php中的内容填充DIV#popup\u manual?特别是,我需要将content.php中指定的表插入#popup_手册。此表必须具有content.php中脚本定义的所有功能(某些按钮) test.php $(document).ready(function() { loadPopupManual(); }); function loadPopupManual() { // to load the P
loadPopupManual()
,才能用content.php中的内容填充DIV#popup\u manual
?特别是,我需要将content.php
中指定的表插入#popup_手册
。此表必须具有content.php
中脚本定义的所有功能(某些按钮)
test.php
$(document).ready(function() {
loadPopupManual();
});
function loadPopupManual() { // to load the PopupManual DIV
$('#popup_manual').fadeIn("slow");
}
<div id="popup_manual">
// I need to fill this DIV with what I have in 'content.php'
</div>
<?php
include_once 'include/connect_db.php';
$query="SELECT * FROM aircrafts;";
$result=execute_query($query);
?>
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
//...
}
</script>
<table>
<tr>
//... some content is inserted here from DB ($result)
</tr>
</table>
$(文档).ready(函数(){
loadPopupManual();
});
函数loadPopupManual(){//加载PopupManual DIV
$('popup#u manual').fadeIn(“慢”);
}
//我需要用“content.php”中的内容填充这个DIV
content.php
$(document).ready(function() {
loadPopupManual();
});
function loadPopupManual() { // to load the PopupManual DIV
$('#popup_manual').fadeIn("slow");
}
<div id="popup_manual">
// I need to fill this DIV with what I have in 'content.php'
</div>
<?php
include_once 'include/connect_db.php';
$query="SELECT * FROM aircrafts;";
$result=execute_query($query);
?>
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
//...
}
</script>
<table>
<tr>
//... some content is inserted here from DB ($result)
</tr>
</table>
$(文档).ready(函数(){
//...
}
//…此处插入了来自DB的某些内容($result)
您只需使用$。获取
$.get('content.php', function(data) {
$('#popup_manual').html(data);
});
因此,它将成为:
$(document).ready(function() {
loadPopupManual();
});
function loadPopupManual() { // to load the PopupManual DIV
$('#popup_manual').fadeIn("slow");
$.get('content.php', function(data) {
$('#popup_manual').html(data);
});
}
您只需要使用$。获取
$.get('content.php', function(data) {
$('#popup_manual').html(data);
});
因此,它将成为:
$(document).ready(function() {
loadPopupManual();
});
function loadPopupManual() { // to load the PopupManual DIV
$('#popup_manual').fadeIn("slow");
$.get('content.php', function(data) {
$('#popup_manual').html(data);
});
}
它会保存content.php中定义的所有脚本吗?还是只显示填充了DB数据的表?它会保存content.php中定义的所有脚本吗?还是只显示填充了DB数据的表?