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?
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?
Share Improve this question asked Sep 18, 2020 at 15:38 Gordon TurnerGordon Turner 1611 silver badge7 bronze badges 7-
Try to delete
bin
andobj
folder, clean chrome caches, also, when you reference the js file, try to add '?' like<script src="script.js?0001"><script>
. – Mr Qian Commented Sep 21, 2020 at 10:34 - Also, try to use control+F5 to refresh your browser. – Mr Qian Commented Sep 21, 2020 at 10:35
- Hi, any update about this issue? – Mr Qian Commented Sep 22, 2020 at 9:48
- Thanks for the suggestions. I was able to find a setting in Chrome (which I am using for my browser) to block the cache, which allowed the program to always use the current version of the .js file. – Gordon Turner Commented Sep 22, 2020 at 11:46
- Also, you can add a ment under the answer to share the detailed configuration with the workaround and this will lead a better guidance. – Mr Qian Commented Sep 23, 2020 at 9:20
1 Answer
Reset to default 8The 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
Check this option and then refresh your web page and it will load the latest version of the javascript file.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744201064a4562879.html
评论列表(0条)