When there is a Javascript error in IE I get an 'Errors on this page may not work correctly' by clicking the tray in the bottom left corner. I've used Firebug and couldn't find anything that could do it yet. Maybe i'm missing something, or is there anything else that offers the same type of functionality of IE script errors, but instead of showing the just the error line #, it will also possibly show a snipped of the code or elaborate a bit more?
In Firefox/Firebug, you can right-click on an element in your browser page and select Inspect Element with Firebug. Once Firebug is open, click on the Console tab. In the console tab, you can choose what kind of errors you want to see. Javascript errors will show with either "All" or "Errors" selected.
It will show you the line number of the error, the error message and give you a link you can click on to open that part of the javascript source so you can see exactly where the error occurred.
There are some types of parse errors where the error is discovered many lines after the cause so the extra line it points to is not always correct. For javascript execution errors, the exact line should always be correct.
The newer versions of IE have something similar builtin. If you press F12, the IE debug console window opens and you can see similar information there.
Chrome and Safari also have a debugger and error console built in.
Related
Please see attached image for reference. Until very recently, Firebug add-on in Firefox would show a red error count on top right and the Console would have the javascript error info.
But looks like Firebug is no longer supported and is being integrated inside Developer Tools: https://developer.mozilla.org/en-US/docs/Tools/Migrating_from_Firebug and for that link you'd see that the error count only could be now displayed but only after pressing Shift+F2 keys - and even then error info not displayed.
I would like to see the error count red as soon as the page loads. I'd also like to see error info in the 'errors' tab of the Console, as it used to be. I have looked for a solution - even tried to revert to older Firebug but so far no success.
Any idea?
Your screenshot obviously shows the Firefox DevTools (with Firebug theme) and not the Firebug.
To see the JavaScript errors in the Web Console you need to toggle the related filter. To do that click the button in the console toolbar.
Having said that, there's a bug regarding the error count causing the number shown in the Developer Toolbar to be wrong, i.e. it often doesn't match the number of errors logged to the console.
Never mind,
Per this post: How to revert Firebug to old version?
I set all instances of browser.tabs.remote.autostart to false and Firebug seems to be working as it was before.
This maybe temp solution but it fixes my problem :)
HTH
From a bookmarklet I need to open firebug and inspecting an element.
I know firebug got a command "inspect" but it seems it's not possible to execute this command from javascript.
Firebug can be driven using the new firefox command line ...but it seems we can not execute command line from javascript.
If you have an idea?
I have a bookmarklet which finds errors in the HTML code. The bookmarklet lists all elements in error. If user clicks on an element, I would like to display it in firebug inspector.
Not sure what exactly you are trying to achieve here. If you are trying to debug your own code then use javascript "debugger" command to cause firebug to break on a given line of code.
If you are looking to trigger Firebug to open at an end user's browser then this would cause confusion for the user and also this option could possibly be a security risk.
Anyway if firebug is deactivated then it can't respond to anything so you wouldn't be able to do this.
You can open FireBug just by pressing F12 in the browser
Javascript containing errors sometimes does not execute without any error message. The following line for example gives a syntax error "missing ; before statement" if you type it in the Firebug console, because it contains a quotation mark at the wrong place:
window.location.href = "some_url?param1="+12+"+"param2="+13
But if you use it on web page, then sometimes the Javascript block which contains it will not execute at all without any error messages in the Firebug console or elsewhere (using Firefox 10.0). In my case I used this example in an OnClick event handler of the fullCalendar jQuery plugin to load a new page if the user clicks on a certain date. How it is possible to force Javascript to enable the display of suitable 'unobtrusive' error messages for Firefox (or Firebug) ?
It depends of course upon the browser you are using if errors messages are displayed or not. IE gives warnings, Firefox does not. Plugins like Firebug or the Web Developer extension come to the rescue here. If you are using Firefox's Web Developer extension you may see a red exclamation mark in the far right of the toolbar when a JavaScript error has occurred. Click on it to open the Error Console.
Firebug is able to show Javascript errors in the "Console" tab, but only if "Show JavaScript" Errors is activated (on Linux select the "Console" tab and click on the right arrow next to "Console" and check the option "Show JavaScript Errors")
Working on a web application and find the Firefox error console to be indispensable.
However I recently upgraded to FF 4 and now when I click errors in the console, the source code doesn't come up like it used to. Not sure it's related to the upgrade but timing is about right.
I've looked over about:config options, made sure the console is enabled, etc. Spent a long time with google trying to find someone else with this problem... nothing.
I get the "hand" cursor when hovering over the URL as if clicking it will do what I expect. However, nothing at all happens. Nada.
I've looked around for hidden windows and even tiny ones but can't find anything...
Any ideas?
Well, I can't exactly figure out why this is happening, but I did find that it only happens when I have the Error Console window on a different display as the main window. I use 2 displays to make debugging easier and moving the error console window to the main display makes it work again.
On a Mac, FWIW.
I am logging using the jQuery.log plugin (which logs to console.log if available) and I am not seeing any of the logging messages appear in the Chrome JavaScript console.
Logging works on Firebug's console under Firefox, but I did have to explicitly enable the Firebug JavaScript console. Have a missed some option somewhere under Chrome?
Edit:
The only thing being logged to the console is
Uncaught Syntax error, unrecognized expression: |button
I assume that the Chrome console is suppose to log statements even after errors like the one above, but there may be some kind of issue with Chrome here, see http://code.google.com/p/chromium/issues/detail?id=29062. I am using Chrome 5.0.375 under Linux and that bug is listed as a Windows XP, Chrome 4.0 issue, it could still apply.
I've just had the same problem and found this question when trying to find an answer.
What fixed this for me was disabling firebug lite in chrome.
It was swallowing all console messages.
Make sure you have the console showing and that it is showing "All".
The cursor is on the button to hide/show the console.
Update: In newer versions of Chrome, you need to click the filter icon, then make sure "All" is selected.
When playing around with example Chrome Extensions, I was often unable to see the console.log messages when looking at console (ctrl+shift+j). But then I realized, that I was in the wrong place.
Wrench -> Tools -> Extensions and then click on the appropriate link under "Inspect active views". (in the Chrome examples it is often background.html) This should bring up the console that you are looking for.
On my computer I had accidently clicked the Debug filter. This made my log messages hidden. Here's how it was before (hidden messages):
Here's how it was after the change (working messages):
I am not sure if this is the case, but if you are using firebug with chrome, you have to turn firebug off in order for console.log() to work in Developer Tools.
I just found out logging was disabled from my filters.
For me, it was because the script was being cached and the browser was not loading my latest version.
Try Ctrl+F5 to reload your page.
Resetting default setting works for me.
While in the console tab, pressingF1 should open the setting page. There you will different settings that you can adjust including the button Restore defaults and reload.
I have this error by have obfuscated javascript code, deobfuscate and console.log work again)