Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changes made in .js not being reflecting when I debug in Visual Studio

I'm trying to debug problems in a javascript file. When I make a change to the file and start the Visual Studio Debugger (F5) a [dynamic] version of the javascript file shows up in the debugger and stops at my break point, but the change I made to the file is not reflected in the [dynamic] version. For example, here is the function in the javascript file:

function GetJobNotes(ScheduleID) {
    var par = "ScheduleID='" + ScheduleID + "'";
    $.ajax({
        type: "Post",
        url: "MaskingScheduleService.asmx/HelloWorld",
        //data: par,
        dataType: "xml",
        //success: GetInfoSuccess,
        //error: ProcessError
    });
    alert("ajax called");
}

and here is what shows up in the [dynamic] version of the file when debugging:

function GetJobNotes(ScheduleID) {
    var par = "ScheduleID='" + ScheduleID + "'";
    $.ajax({
        type: "Post",
        url: "services/MaskingSchedule.asmx/GetJobNotes",
        data: par,
        dataType: "xml",
        success: GetInfoSuccess,
        error: ProcessError
    });
}

How do I get the [dynamic] version to match the code in my javascript file?

like image 940
Gordon Turner Avatar asked Oct 27 '25 15:10

Gordon Turner


1 Answers

The issue is that there is an option in Chrome that breaks the updated js file. With that option, Chrome will block the changed js content and always use the previous js content.

Solution

When starting vs debugging under Chrome, please press F12 and then select Network menu.

This is an option called Disable cache

enter image description here

Check this option and then refresh your web page and it will load the latest version of the javascript file.

like image 139
Mr Qian Avatar answered Oct 29 '25 05:10

Mr Qian