admin管理员组文章数量:1401264
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.
本文标签: javascriptChanges made in js not being reflecting when I debug in Visual StudioStack Overflow
版权声明:本文标题:javascript - Changes made in .js not being reflecting when I debug in Visual Studio - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744201064a2594963.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论