Debug function for FireBug
If you do much JavaScript coding and have FireBug odds are good you know that you can call console.info() to output to the FireBug console. But what happens if you leave your console.info() call in your code and a visitor looks with IE? It'll throw an error. So here's a quick, little function that will output to the console if it's available and do nothing if it's not. That way you don't get any errors if you forget and leave a call in your final version.
JavaScript:
-
function debug(message)
-
{
-
if (typeof console != 'undefined' && typeof console.debug != 'undefined')
-
{
-
console.info(message);
-
}
-
}
Question, Comments...
Do you have more questions. Please either leave a comment below or join us in our new forum.