Debug javascript object Chrome

Asked

Viewed 375 times

2

I put a break point in my function javascript(F9) and then I give F12 in the chrome with the application open. I press a button that will call this function for example and does not stop at the break. I can’t see what each variable, parameter is being passed. How do I do it? No IE, I can, although with the script debug "turned on" and giving those script errors, but I can. I would like to Chrome.

2 answers

2


You’re confusing Debug by IDE Development with Debug through the Chrome DevTools.

to create Breakpoint, use F12 to open the Chrome DevTools, go to the tab Source, look at the list of sources and look for the Javascript you want to debug, then put the breakpoint of the desired place.

An alternative flow would be to load the page with the Chrome DevTools open on the Aba Network filter through Documents and/or Scripts, locate the desired file, right-click,Open in Source-panel.

If you want to debug using an IDE like VS, you should open the application with the Internet Explore.

  • How I see the value of a variable or parameter in the Chrome debug. I have thus: var Abrir modal = Function (url, title, width, height) { dialog.attr("src", url); dialog.dialog("option", "title", title); dialog.dialog("option", "width", width); dialog.dialog("option", "height", height); } then I want to know the value of the url parameter, for example. I put the mouse on top, but I can’t see anything. I can’t get the value of the parameter.

  • put breakpoint within the method?

  • Yes, I put and I want to take the value of variables or parameters and nothing.

1

Are you sure breakpoint is correctly placed in your code? If you use a console.log in that spot he’ll write straight?

If everything is ok, try instead of using the manual breakpoint of Chrome to put one debugger in your code, and any browser must stop on that line.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.