I'm trying a simple console.log function in Firefox:
console.log("Hello, World!");
You may try it on: http://jsfiddle.net/EkZjK/
You may also try the full code in a stand-alone HTML file:
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<script type="text/javascript">
console.log("Hello World !");
</script>
</head>
</html>
I get console logs in Chrome.
But in Firefox I cannot see the logs.
I tried the Firebug console and Ctrl + Shift + J.
Both don't show the log message in Firefox.
PS: I restarted Firefox, restarted Windows, tried on another machine, deleted the Firefox profile and created another one, and reinstalled Firefox. But the problem still exists.
How can I solve this?
For some previous versions of Firefox
I had the same problem with a different root cause.
Hit Ctrl + Shift + K to open the full console. In the second row from the top there are tabs - Net, CSS, JS, Security, Logging, and Server. Hit the triangle to the right of "Logging" to open the dropdown and make sure that at least "log" is on.
Reinstalling the Firebug plugin solved the issue.
Now it appears in the Firebug console (not in Ctrl + Shift + J).
For Firefox 77.0.1 and Ubuntu 18.04 (Bionic Beaver) LTS (Bionic Beaver):
I had the same problem.
Open the Firefox console - Ctrl + Shift + J.
In the browser console, click on the top right settings icon. In the dropdown, click on Show Content Messages.
Then console.log messages will start showing up in the console.
Uninstall Firebug (or disable it)
Press F12 and enjoy the console.
The problem is Firebug. It's not maintained anymore and may be unstable (see the official page). Other users here recommend to update it, but it may not work, or work until the next Firefox update.
I had this problem in Firefox 71, and I found that when you open the console not everything is automatically logged.
When you go to the right side of the console you see a number of buttons, (Errors, Warnings, Logs, Info, Debug, CSS, XHR, and Requests). Enable all logs by clicking these buttons.
I had the same problem with Firefox 75.0 on Ubuntu 18.0 (Bionic Beaver). The following solved it for me:
Open the Console
Click the Logs button until grey in Filter output row on the right
Click the Settings gear on the right and choose in the dropdown "Persist Logs".
I had the problem again today with Chrome and Firefox.
Ultimately, however, the cause was not the console, but some code in jQuery UI v1.12.1.
After I had written console.clear() after the jQuery UI code, the console outputs after this script were shown again.
I recently had the same issue with Firefox. What worked for me was restarting Firefox and then adding the Console.clear() method to my script. Once the page loads up, the console logs your messages again.
In FireFox 90.0, Mac OS 11.4, I had to click on the Gear Icon and put a check mark next to 'Show Content Messages' before console.log output appeared on the console.
Edit: I see now this was mentioned in the fine print on one of the responses above.
I had the same problem with my browser but all you’ll have to do is to open up the console by pressing ctrl + shift + k or press the right key and press inspect then navigate to the left hand section that says logs click on it and you should be good to go
Related
I've created an extension using kango-framework, it works ok in Chrome and Opera 20, but when installing it on Firefox 27 or 28, I get error "aAddon._repositoryAddon is null".
Any guess? Thanks
I don't think aAddon has _repositoryAddon as a parameter. Find out by including Console.jsm and then going console.log('aAddon',aAddon). (Try just doing console.log Console.jsm might already be included). Then open up Browser Console. then in browser console, should be latest entry, find your aAddon msg then on the link next to it, click it, and it opens in variable viewer. There you can see what all properties aAddon has.
http://smg.photobucket.com/user/noitidart/media/i20dont20see20nsIInterfaceRequestor_zps7bfc9d43.png.html?sort=3&o=12
http://smg.photobucket.com/user/noitidart/media/my20code20works_zpsdd244f45.png.html?sort=3&o=11
How do I know which part of JavaScript that is executed when some event is occurred in Mozilla Firefox?
This is a very broad question but I'll take a shot. I was a bit curious about the now native debugger in Firefox so I looked into this for you. Firebug is still a nice tool but you don't need it for debugging if you're running Firefox 19 or later. Let me also suggest trying Chrome's DevTools, they are my personal favorite.
To use the native debugger in Firefox, there's two options you will need to configure. Go to about:config (paste that in the address bar). Proceed past the warning. Update the following settings to be true (search is your friend):
devtools.chrome.enabled: true
devtools.debugger.remote-enabled: true
You need to do that so you can set breakpoints in the code. Now load the debugger, the shortcut is Ctrl+Shift+S.
At this point you need to have some idea where to set your breakpoints. If you wrote the JavaScript, you shouldn't have much trouble. If you're inspecting 3rd party code, you might need to browse the source code to get an idea where to begin.
With the debugger loaded, select a source file in the dropdown. It could be a JavaScript file, or any other resource that has JavaScript. You should open whichever file you're interested in inspecting.
To add a breakpoint, click to the left of the line number. You can also right-click on a given line and select "Add breakpoint." If you are debugging something that happens on page load, refresh the page. If it's an event handler, interact with the page to fire the event.
Those are the basics you'll need to get started with debugging in Firefox. Here are some resources you might need to go further.
MDN article: Debugging JavaScript
YouTube video using FireBug: Firebug DebuggingIntro
Chrome DevTools: Breakpoints in Chrome
I hope that helps!
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727)
Timestamp: Wed, 18 Jan 2012 05:02:49 UTC
Message: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)
Line: 0
Char: 0
Code: 0
URI: http://collaborize.collaborizeclassroom.com/portal/portal/collaborize/site/window?actionEvent=homePage&action=2&fpg=1&unId=umb8N95lhIoXOVKzTTrtcPoCrixd4wMdScQv8mEwqFT962zy3VSh4mzQNeugOWVV&ts=1326862916939&publishUrl=class2&siteName=class2&siteId=20941
I get the above problem only when i open and close the browser and log-in for the first time and even though i delete cache,cookies and history and login again i don't get the problem.
is there something else other than the above that gets deleted when we close the browser because the error only comes when i login the first time after i open the browser
Example: call document.body.appendChild when the page has not loaded.
Need to call javascript when the page is loaded, example:
document.body.onload = function()
{
document.body.appendChild(...)
}
Add few characters spaces in-between script tags to fix this.
ie., space inbetween start and close script tags in case you are referring outside library using src attribute
IE takes some time to render elements. In that case, if we are referencing the element in Javascript it will throw this error.
Solution is to check on your Javascript or Jquery codes and use the codes inside the $(document).ready(function() { } function.
It works for me.
This is a bug in IE8.try following the method provided below. After using this my problem is resolved.
Reset your Internet Explorer settings and run it. You can do this by following the steps given below.
If the problem is caused by damaged or incompatible Internet Explorer settings or add-ons, you can usually resolve the problem by resetting Internet Explorer settings.
To use the Reset Internet Explorer Settings feature from Control Panel, follow these steps:
First of all clear your IE history.
Exit all programs, including Internet Explorer (if it is running).
If you use Windows XP, click Start, and then click Run. Type the following command in the Open box, and then press ENTER:
inetcpl.cpl
If you use Windows Vista, click Start Collapse this imageExpand this image . Type the following command in the Start Search box, and then press ENTER:
inetcpl.cpl
The Internet Options dialog box appears.
Click the Advanced tab.
Under Reset Internet Explorer settings, click Reset. Then click Reset again.
When Internet Explorer finishes resetting the settings, click Close in the Reset Internet Explorer Settings dialog box.
After that you have to download the Cumulative Security update for Internet Explorer KB2360131 to resolve this.
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=27630 (Windows XP)
OR
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=27622 (Windows Vista)
-- Start Internet Explorer again.
Not sure if this will be on any help but it might give you an idea of your problem.
I'm still learning js but I got the same problem and only in IE8. I had suspicion that it was the facebook plugin I got from facebook which stated to place the code at the top of page. I removed the code and page loaded without error then added it back and I got the error. I moved the code to the bottom of the page and it worked with no errors. The page even loaded faster.
I added the $(document).ready(...) and still had a problem. After further analysis, I isolated the problem to an em value in a CSS media query (I am using respond.js). I have not investigate the root cause further, but I was able to consistently view the page without errors after switching the media query from ems to pixels.
The problem happens when JS tried to appendChild to a DOM element that has not finished loading. I fixed with
window.onload=function() {
//append code
}
if the issue is still happening within here I would surmise that the ready code is creating new elements and trying to append children to them before they are loaded.
To solve the issue:
Please check your source codes, that all the HTML tags are opened and closed properly.
If all are fine then you will not get this kind of errors in IE.
I have an firefox extension with the name myjavascriptfile.js,As I am new to this addon concepts,just I want to debug this script.So I am using the following statements in this file like
function LOG(text)
{
var consoleService = Components.classes["#mozilla.org/consoleservice;1"].getService(Components.interfaces.nsIConsoleService);
consoleService.logStringMessage(text);
}
observe: function(subject, topic, data)
{
LOG("observe called ");
}
I know this observe is getting called but I dont know where to see my log message.can some one tell me Where it is printing?
Please help.
That text goes to the Error Console. You might need to go to about:config and change devtools.errorconsole.enabled preference to true - the Error Console was removed from the menus by default while ago (strangely enough, I could still see it even without this pref). I think that on OS X you can still open the Error Console via Tools / Web Developer menu, on Windows you have to click the Firefox button and choose Web Developer menu there. Alternatively, Command-Shift-J should do as well.
I have a page with a Google Maps component, and I am using navigator.geolocation.getCurrentPosition() on initiating the map so that I can show "local" items.
Everything works great, other than the behavior of the location prompt - In the past I thought I had seen where you could choose to allow FireFox to remember this setting, but that has either been removed from FireFox, or there is some flag/setting that I'm not using that would enable this... anyone have any insight?
See this page for a screencap of the 'remember' checkbox:
http://diveintohtml5.info/geolocation.html
Thanks,
Paul
EDIT:
Ok, looks like I am only seeing this issue in FireFox 4, in that it doesn't seem to give me the option to remember the site in the prompt, which means it prompts each and every time. FireFox 3.5 works as expected. Is this expected behavior? I can manually set it to never ask by going into Page Info for the page, but the typical user is not going to know how to do this.
Well, it appears that version 4.0.1 of FF doesn't have the 'remember permission' checkbox... the user will get prompted each and every time they hit the page until they perform the following steps:
Right-Click->'View Page Info'->'Permissions' Tab->'Share Location' and then un-check 'Always ask' set the radio button to 'allow'.
Seems like most people would never know to look there for this setting though, hopefully they re-introduce the dialog 'remember' checkbox.
If you did already gave permission, Firefox will not ask again. You may undo it according http://www.mozilla.com/en/firefox/geolocation/