Hovering over a name does not show its value.
1. Using the
debugger; var name = $('#input_price').val();
We write this line where we want to stop.
debuggerprovides access to any debugging functionality available in a particular environment, such as setting breakpoints (so-called breakpoints).
For the breakpoint to work (paused) – you need to open the source code of the current page in the browser (for example, in Google Chrome , this is the View code item)
It can be used as debugging information and for further inspection and debugging of the code. Quite a banal way, but very effective. For example, I want to see what was in a variable using your code:
var name = $('#input_price').val(); console.log(name);
console.log method – prints messages to the web console. Similar to the previous paragraph, open View Code , go to the Console tab – and see what we had in the
name variable. Simple and efficient. And finally, let's move on to what should help you.
.cshtml to a separate
As I said at the beginning: debugging
MyCshtml.js ), put it in a folder (
Scripts , for example), somewhere nearby, and connect it on the page something like this:
4. Visual Studio 2017 paired with Internet Explorer 11 and
Perhaps the most banal way, as the practice of reasoning with @Grundy has shown, is to use the
- We choose the default browser to open our site Internet Explorer .
- Open the site in IE and go to Settings -> Internet Options – tab Advanced – section Overview , uncheck the line: Disable script debugging (Internet Explorer) , click Apply , and then OK
The breakpoints at the location of the
debugger keyword are then triggered inside the Visual Studio 2017 development environment.
Tested on VS2017 paired with IE11 on Windows 10 operating system.