Ajax did not fully read the contents of the txt file

the following code, ajax does not fully read the contents of txt, what is the reason?

function showtxt(txtname){
    var getData;
    $.ajax({
        url:"txt/"+txtname,
        dataType:"text",
        async:false,
        error:function(){
            alert("orz");
        },
        success:function(data){
            console.log("showtxt work"+data);
            getData=data;
        }

    });
    // console.log(getData);
    return getData;
}

txt content to be read:

F12:

(it could have been read normally, but after adding "hula hul" to the txt content, save it and then read it, but found that the updated content was not read)

Jul.23,2021

may be a cache problem. Try adding a timestamp to the ajax request

url:"txt/"+txtname + '?v=' + Date.now(),

positive solution upstairs

Menu