Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用其他PHP文件中指定的HTML表填充DIV容器_Php_Jquery_Html Table - Fatal编程技术网

用其他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数据的表?