Chrome Developer Console Error doesn't show problem code when clicked - javascript

Sometimes Chrome Developer Console Errors don't show the problematic code when I click on the link in the error. It just shows a blank window. I haven't found a pattern to it. Has anyone else had this problem?

Related

Got javascript error but can't find where the code is in chrome's developer tools

My website http://a.nycweb.io has this javascript after loading, by clicking the error, I only find a blank line, as shown in picture:
How am I supposed to debug this?
UPDATE
I actually found the code from Safari's developer tool, in which when I click the error, the line in question properly shows up.
Is this some bug with Chrome's dev tool?

console.log not appearing on screen?

I feel that this is a very, very basic question, so please excuse me in advance. I've created both an HTML file that links to a Javascript file, and in the javascript file, I have console.log("Random Statement"). But it's blank for every browser I try it on.
I have tried reading forums, and have gathered something about "developer tools" and F12, and Firebug. But can someone please give me a concrete answer as to what I need to do to make "Random Statement" appear on the screen?
In Firebug, choose 'Console' from the menu at the top (it's the leftmost choice). When your call executes, the message will appear in the console window. I use console.debug rather than console.log.
You will need to use development tool (F12 for most browsers) or download Firefox and Firebug plugin(F12).
Console is a way of debuging your code (in case of errors).
You can also use alert(); or write() in Javascript
Also if you post some of your code, it would be useful for us to check your syntax, because that could also be an issue
console.log writes to the browser's console. In chrome f12 pulls up the dev tools. From there click console to see the actual console.
alert() will output it in a dialog to the "screen"
$('#someId").html() will do it in jQuery to a particular DOM element id="someId"
How to use the Chrome console:
https://developers.google.com/chrome-developer-tools/docs/console
Try this if you want console.log to output to the screen
console.log = function() {
document.writeln(arguments[0]);
}
And then
console.log("Message");
Should do it

Debugging Website with JavaScript errors in IE9 - opening debug console fixes the error

I have a website which triggers some JavaScript errors in IE9. When opening the debug-console with F12 and reloading the page, the problem disappears and everything runs just fine. This is clearly annoying and therefore it's difficult to detect the error message in order to solve the problem.
It's a page with a Google Map. Normally, there should be markers on the map. In IE9, there aren't. When opening the console, everything is working.
Does anyone know how to debug this annoyance?
In IE, the console object is not available unless the console is open. That's what's causing the errors when it's closed. Remove all references to console from your code and you should be fine.

chrome.windows dosen't have "getLastFocused"

I am having strange error in my chrome extension, I can see that for some of my users they get the next error -
Cannot call method 'getLastFocused' of undefined.
This is my code:
// In background.html
chrome.windows.getLastFocused(function(win){ });
I can't recreate this problem, I see the problem happens in chrome 9-12. Someone have idea why it happens? how to reproduce?
Edit: I have the same problem with "getAll" function

how to check javascript syntax error

Firebug looks not capable to check js syntax error...
Is there any good way to do that?
Currently I just wrote a js but the firebug didn't show any error but the functionality is totally broken.
Firebug does do it. Make sure that you have JavaScript Console enabled, you can do so by clicking the Console dropdown and from their select Enabled. You need to press F12 key to open firebug and once you refresh the page, you will see any errors you have in your script in the firebug js console.
If you are using Firefox, you can also press Contr+Shift+J to open firefox's error dialog.
are you sure Firebug is turned on? If it's on, the little bug in the lower right is colored brown. if it's not on, the bug is gray.
also, I find that Web Inspector in Safari/Chrome is better.

Categories