我的代码有什么问题?它根本不打任何电话。我什至尝试将错误添加到 php 文件中,但什么也没发生,所以它显然没有调用它。是的,我已经多次检查了路径并且它是正确的。
该按钮确实有效,单击时它会将 h1 标签更改为绿色。
$(document).ready(function() {
        $("#search-button").click(function(event) {
            event.preventDefault();
            $("h1").css('background-color', 'green');
            var word = $("#searchbar").val();
            $.get("video/search_videos.php", {searchword:word},
                function(title) 
                {
                    $("h1").html(title);
                    $("h1").css("background-color", "red");
                },
                "json");
        });
    });