: How to check with Firebug if a JS function is applied How can I check with Firebug if on a certain page a specific JavaScript function - jQuery based - is applied?
How can I check with Firebug if on a certain page a specific JavaScript function - jQuery based - is applied?
More posts by @Sarah324
2 Comments
Sorted by latest first Latest Oldest Best
While Christopher's answer is somewhat correct, many times you won't want to use a tracepoint that interrupts execution and requires manual interaction to resume execution (at that point it's technically a breakpoint).
With Firebug or equivalent browser debug consoles, you can insert tracepoints into your code using console.log(). AFAIK, the console object isn't a standard JavaScript/ECMAScript construct, but it's supported in:
Firefox with Firebug or ConsoleĀ² installed
Firefox 4+ through the Web Developer Tools
Chrome
Safari
IE8+
Opera 9+
many other browsers using Firebug Lite
I believe you need to have the console window actually open/enabled in many of these environments before the object is actually accessible, and then there's the issue of browsers which don't support the window.console object or having debug code accidentally slip into a production application. But there are many solutions to these problems as well:
stackoverflow.com/questions/783661/log-to-firefox-error-console-from-javascript patik.com/blog/complete-cross-browser-console-log/ stackoverflow.com/questions/217957/how-to-print-debug-messages-in-the-google-chrome-javascript-console
The point is, there are better ways to debug than just throwing an alert() box. And if you've got Firebug installed but aren't yet familiar with Firebug's JavaScript debugging facilities, this is a good overview.
JQuery or not, JavaScript will stop executing code after an error... most of the time on the entire page (There are a few exceptions though). Using Firebug is overkill when you can just toss in an alert("IT WORKS"); at the end of the suspect function. If the popup works, then the function is applied. Giving more information as to exactly what function you're referring to would help.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.