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.
Related
Okay, here's my problem. I wrote some JavaScript for a page, for some reason the page doesn't work in Chrome. The site does what I expect in Opera, Chromium and Firefox. In the Choom devtools there is a kind of error showing in the source tab showing "JavScript is disabled" in a mouse hover popup:
I turned off all chrome's extensions, Javascript in on in the content settings and I cleared all JavaScript exceptions I had, but this didn't seem to change anything. The weird thing (an other one) is that some other sites give the same alert icon in the devtools (including this one) but JavaScript works just fine.
If you perform the exact same functions in the console then, some of, the functions perform just fine.
Does anyone have an idea what I could be because I am out of idea's and it is really annoying that I have to switch browser to test the page (page is 'live' here). Thanks
Have you checked the DevTools settings? You might have accidentally enabled "Disable Javascript"
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
My html page cannot work in IE browser. If I turn F12 developer tools on, it starts to work. My page can work with chrome. I guess it is caused by jquery and javascript. Can anyone know how to make it work? Thanks
IE crashes your script if you're using console.log anywhere inside it. Developer tools adds the console functionality - therefor it works if you open it. Remove the console.log and it should start working just fine.
Chrome/Firefox support this by default, thats why it works there no problem.
you're probably using console.log() in your code somewhere. In IE console object doesn't exist unless the dev tools window is active.
I recently switched from Firefox to Chrome and I (probably) missed an important feature. I was used to test javascript snippets on FF from within the Firebug console this way: open the console, write the script and finally press CTRL + Return to execute the code.
It seems not possible to do the same in Chrome console, as when I type some code there and press return to start a new line the code is executed immediatly.
Is there a way to replicate the Firefox behavior on Chrome?
Thanks.
It seems that there is no explicit “multiline mode”.
But you can:
Paste code (it will preserve multiline)
Shift + Return to add a new line without executing the script
Related bugs:
https://bugs.webkit.org/show_bug.cgi?id=30553
http://code.google.com/p/chromium/issues/detail?id=72739
You can also hit Shift + Enter to start a new line without running the code in Chrome's console: https://developers.google.com/chrome-developer-tools/docs/tips-and-tricks#multiline-commands
Install Firebug Lite for Google Chrome. It has got a console.
Don't look for a full fledged Firebug. You will be disappointed :)
Oops,I didn't read properly at first. My bad!
In Firebug Lite, take Console. Then you will see a tiny red up-arrow at the right corner.
Click on it and you will get a multi-line console. Won't you?
I recommend this:
Write debugger; and hit Enter, in the console tab
This takes you to the Sources tab; if not, make sure debugger breakpoints are active
Now you can write whatever you want in the Sources tab, which acts like a full IDE with features like newline and indentation
Select any part of your code to run, and right-click, choose Evaluate in console
Better way of doing this using Chrome featue i.e Snippets where you can write javascript and save it in chrome developer console.
Its available underneath source inside developers tools while inspecting element.
More info about the snippets can be find on this link.
It was available in Chrome canary and I guess now it is available in default chrome browser also.
For some reason firebug is not showing that litte red 'X' icon in the bottom right corner anymore in my localhost development.
Is there a setting that I might have somehow changed?
I purposely make an error in my .js file and I get nothing!
In Firebug, click the dropdown next to the "Console" tab, and check "Enable console for Local Files".
Many asynchronous callbacks "swallow" errors. That is, any error can occur in the callback and it won't show in Firebug or any just-in-time debugger I know of. However, with "Break on All Errors" on, Firebug will stop. Look for that in the Script tab options.
Are you using TrimPath? It can also "swallow" errors.
To be honest, I have no idea. But I have run into firebug issues before and reinstalling takes about 2 minutes and usually fixes the problem
Do you have anything like this in your javascript?
window.onerror = function(){
return true;
};
This will suppress any normal behavior of errors.
Is the Firebug icon yellow or grey? If it is grey, then Firebug is turned off (or all the panels are disabled).