Can Firebug run my site?

I am working on a new project that has complex javascript. I cannot post any code, lest the question I'm talking about.

I have a script that works in Firefox 3.0. It has been pointed out that the script is not working in Firefox 3.5, so I am trying to get it to work. Indeed, the script did not produce the expected results, so I installed the latest version Firebug, turned on consoleand updated the page.

And wow, that worked.

No errors, no warnings.

So, I turned off the console, and then it didn’t work anymore ...

What's going on here? Does the Firebug console somehow change something in Firefox, what makes my script work? Any tips on what's next? (in addition to future visitors installing Firebug ...)

+5
source share
4 answers

Maybe it's as simple as forgetting to comment on a call console.log()somewhere in your javascript?

If you have links and the user does not have Firebug installed, you will get a runtime error that will stop the script from executing.

+10
source

, , FireBug , , , , .

, ajax, - ? , , - , - DOM?

UPDATE: , , "" JavaScript (- ..). . , , .

+7

console.log(), console.debug(). window.console , undefined ( ).

.

+6

I wrote a simple shell for firebug (I just use debug, but it should give you what you need to duplicate other methods), which is written only when the console exists, so I can use firebug, no need to leave a comment from mine debugging statements, and it does not crash sites for people without it.

If you use this code, use fbconsole.debug instead of console.debug, you will never have this problem:

function fbconsole () {
    this.debug = function (val) {
        if(typeof(console) !== 'undefined' && console != null) {
            console.debug(val);
            }
        }
    }
var fbconsole = new fbconsole();
0
source

All Articles