Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/76.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
在javascript/jquery文件中应用更改时出现问题_Javascript_Jquery_Django Templates - Fatal编程技术网

在javascript/jquery文件中应用更改时出现问题

在javascript/jquery文件中应用更改时出现问题,javascript,jquery,django-templates,Javascript,Jquery,Django Templates,假设我有如下代码: $(document).ready(function () { $(".likeBtn").click(function () { var serializedData = $("#likeForm").serialize(); let id = $(this).attr('id'); let url = $(this).attr('data-url'); let

假设我有如下代码:

$(document).ready(function () {
    $(".likeBtn").click(function () {
        var serializedData = $("#likeForm").serialize();
        let id = $(this).attr('id');
        let url = $(this).attr('data-url');
        let button = $(this).text();
        console.log(id);
        console.log(url);
        console.log(button);
        $.ajax({
            url: url,
            data: serializedData,
            type: 'get',
            dataType: 'json',
            success: function (data) {
                console.log(data);
                $(`#${id}.counter`).html(data.likes_counter);
            }
        })
    });
});
我刚刚删除了一行代码,但当我在浏览器(Chrome)中运行它时,源代码显示的是旧版本。我试图在VS代码中保存代码,试图重新运行服务器,但没有任何帮助。有时它可以立即工作,但我经常遇到像现在这样的问题。我不能测试新代码,直到一段时间过去。控制台下方:


尝试清除浏览器缓存并查看。我不确定,但可能是它,谢谢。尝试清除浏览器缓存并查看。我不确定,但可能是它,谢谢。