3

I want to debug java-script or j-query embedded in the same view of razor page in google chrome

@section Scripts
{
<script type="text/javascript">
    $(document).ready(function ()
    {
        var myClass = new MyClass();
        myClass.DoSomeStuff();
    });
</script>
}

how to debug and put break point in google chrome. because i cannot find script in source tab?

0

3 Answers 3

2

Did you try to add the word debugger into your code ? maybe it can help you.

<script type="text/javascript">
$(document).ready(function ()
{
    debugger
    var myClass = new MyClass();
    myClass.DoSomeStuff();
});

Sign up to request clarification or add additional context in comments.

1 Comment

Reference to debugger
1

In chrome dev tools there is a debug tool.

  1. Go to Dev Tools (F12)
  2. Go to the sources tab
  3. Choose the file you want to debug
  4. Choose breaking points, like this: enter image description here

  5. Press on F5 to start the debug mode.

  6. Press on F10 to see each interaction.

Comments

0

In my case, script file is in localhost/scripts/app.min.js but it is minified (compressed) so after selecting curly brackets at the left bottom you can pretty print that script file and put break points.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.