Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript

Ben Os
Ben Os
20,008 Points

A Javascript workshop suggestion

I would humbly suggest creating a short workshop with tips and further explanations on the action of listening to events on elements via the devtools.

Why I need this?

Well, I bought a quite complex Wordpress premium theme that has tons of inodes and some Js files.

Between thesethere is a file containing the if statement I need to change (a statement that says something like the pseudocode: "if viewport is less than 840 px, display none the desktop menu and show the mobile menu").

For now, I didn't find that file so I thought of just selecting it's element, putting an event listener somehow, click it, and see directly on console what is the file I should go to (similar to seeing what is the CSS file the directive is located at).

I know this is possible to be done from console, but AFAIK, there is no workshop that will actually explain on how to do this "find a script filename by listening to an element's triggered event with the dev tool".

I think such a workshop could be super handy, and very practical for us students.

Would glad to know what you think, my dear, estimated Javascript teachers, Dave McFarland Joel Kraft Guil Hernandez

1 Answer

Joel Kraft
STAFF
Joel Kraft
Treehouse Guest Teacher

Hi Ben Aharoni,

There is a workshop on debugging in the browser, and this video appears to address the specific topic you mention here. Let me know if this wasn't quite what you were looking for.

Thanks, Joel

Ben Os
Ben Os
20,008 Points

Hi Joel. I tried to watch it, I didn't very much understand what was done, why did you click where; I tested a webpage in my browser and got many files there in the left pane and didn't know what should I usually choose. Also I think a more deep review of the whole concept of "breakpoints (programming)" is needed and more deepening what are "event listener breakpoints" and control options to work with (what are the main ones).

I felt as if this whole debugging issue should have an actual course, maybe through a track on debugging with a course on Javascript with short stepped videos of not more than 3 minutes and with 2-4 quiz questions each time to consolidate the knowledge. I would learn this either way the moment I'll have a serious need in this (my last problem actually didn't necess element event listening to be solved, I had a mistake there) but I really think a course is needed. The whole issue of debugging, working with a debugger like DevTools and Netbeans needs a stepped, accessible course.

Joel Kraft
Joel Kraft
Treehouse Guest Teacher

Thanks for the suggestion, Ben.

Out of curiosity, have you taken the prerequisite course DOM Scripting By Example? Or were you at least familiar with the app used in the workshop? This workshop relies heavily on that material, and knowing how events are handled in this app may have made that video make more sense.

At any rate, thanks again for your feedback. I'll submit it to our process for content review.

Ben Os
Ben Os
20,008 Points

I took DOM scripting by example about 3 months back, I remembered the app only in general lines. Thank you for mentioning it.