回声响应​​在回声div中克隆头文件

时间:2019-01-15 15:03:20

标签: php jquery ajax echo

在ajax请求之后,我在类为echo的div中发送了响应。 这是我的html结构:

<div class="container-fluid">
    <div class="fixed-header>
       <div class="echo"></div>
       ----

ajax看起来像这样:

$.ajax({
        url: "",
        type: "POST",
        data:  new FormData(this),

        contentType: false,
        processData: false,
        success: function(response) {
        $(".echo").html(response);
        },
 });

提交后在DOM中查看时,我看到所有head文件(如样式表和脚本)都已重新加载。那正常吗?应该是这样吗?见下图

enter image description here

添加了Php代码:

if($_POST['deletefile']) {      

        // if is directory -> remove dir
        if(is_dir($_POST['deletefile'])){

        removeDirectory($_POST['deletefile']);
        include('includes/delete.php'); // echo
        exit;

        }
        // else (must be a file) -> unlink file
        else {

        unlink($_POST['deletefile']);
        include('includes/delete.php'); // echo

        exit;
        }

    return false;   
}

0 个答案:

没有答案