The interface display is not consistent with the result of response.

the interface display is inconsistent with the response result.

,var_dump

where the red box is, response gets the correct data, but the interface is wrong.

printed in var_dump, different

frontend request:

<script>
    var investigationTaskId = "";
    function receiveMessage(event) {
        var origin = event.origin
        if (origin !== "http://localhost:8082")
            return;
        investigationTaskId = event.data;

        $.post("/member/project",{
            "investigationTaskId":investigationTaskId
        },function(result){})
    }
    $(function(){
        window.addEventListener("message", receiveMessage, false);
    })
</script>

backend receives and queries

$investigationTaskId = $_REQUEST["investigationTaskId"];
    $sql = "SELECT a.name ,COUNT(w.pk_works_main) AS num ,a.atlas_type,a.pk_atlas_main FROM ".$Base->table("atlasmain")." a LEFT JOIN ".$Base->table("worksmain")." w ON a.pk_atlas_main = w.pk_atlas_main WHERE a.investigationTaskId="".$investigationTaskId."" AND a.pk_user_main= ".$user["pk_user_main"]." GROUP BY a.pk_atlas_main ";
    var_dump($investigationTaskId);
    $result = $Db->query($sql);
    $tp->assign("atlas",$result);
Jul.20,2021

question of the first picture:

responseCSS

question of the second picture:

htmlNULLhtml

if it is not a request page, it is recommended that the data returned by the backend should be in json format. Other formats are not convenient for js to extract

Menu