jQuery Ajax call returning '[object XMLDocument]'

后端 未结 5 480
闹比i
闹比i 2021-02-01 23:06

I have an HTML page which I want to populate using Ajax. I\'ve copied code from other pages, (which are all in PHP, and I\'m not sure if that matters), and it\'s returning

5条回答
  •  伪装坚强ぢ
    2021-02-01 23:52

    You need to include the datatype parameter on you AJAX call to indicate that you are simply expecting a text response:

    function getSplashHelpVideos() {
        $.ajax({ 
            url: "include/get_help_videos.php",
            type: "POST",
            dataType: "text",
            success: function(data) {
                alert(data);
            }
        });
        return;
    }
    

提交回复
热议问题