DebugBar Forums
 
 HOME 
 DOWNLOAD 
 BUY 
 DOC / WIKI 
 FORUM 
 CONTACT 
Stay tuned : rss feed

Forum Home


advanced search


You are not logged in.

Announcement

When reporting a problem or a bug :
* Provide your OS version (INCLUDING service pack) and installed IE version.
* Provide your IETester version
* Provide the IE Tab version opened to generate the problem
* Provide a test case with a sample url or sample code to reproduce the problem
* Provide a step by step explanation on how to reproduce the problem.
* If needed provide additional information.

Thanks.

#1 2009-04-10 15:51:38

Nickolas
New member
Registered: 2009-03-21
Posts: 8

type definition of console variable

well. it 's me again! smile (Vista sp1 Ultimate)

Okay I have a question. I wrote the following codes.

Code:

var __empty_function = function(){};                // Boş Fonksiyon

var console = console || {                         // Yararlı bir Hata Yakalama Aracı: http://www.my-debugbar.com/wiki/CompanionJS
    log:     __empty_function, 
    debug:   __empty_function, 
    info:    __empty_function, 
    warn:    __empty_function, 
    error:   __empty_function,
    assert:  __empty_function,
    dirxml:  __empty_function,
    time:    __empty_function,
    timeEnd: __empty_function
};

But it didnt work... Becuase console variable has not a type definition.

Code:

alert(typeof console);

return 'undefined'

But How am i use this console to other browser what ever takes? Firefox haven't plugin that is why giving error. So my codes has been down and I have to clean the console code lines...

The explaination is too bad ha? smile

Last edited by Nickolas (2009-04-10 15:52:03)

Offline

 

#2 2009-04-10 16:01:34

fabrice
DebugBar Support
From: San Francisco, CA, USA
Registered: 2007-11-08
Posts: 1182
Website

Re: type definition of console variable

Hi,

Do you have Companion.JS installed ? and which version ? When I try :

Code:

if (console) alert('ok'); else alert('no');

it opens "ok" box.

Try to open the Companion.JS bottom panel and try "console" on the console. You should have "{...}' which means it is an object so it is defined.

So your code should work with Companion.JS and you should have the console feature.

Offline

 

#3 2009-04-10 17:37:29

Nickolas
New member
Registered: 2009-03-21
Posts: 8

Re: type definition of console variable

Sorry but that 's not working...

I tried this

Code:

console = console || {                         // Yararlı bir Hata Yakalama Aracı: http://www.my-debugbar.com/wiki/CompanionJS
    log:     __empty_function, 
    debug:   __empty_function, 
    info:    __empty_function, 
    warn:    __empty_function, 
    error:   __empty_function,
    assert:  __empty_function,
    dirxml:  __empty_function,
    time:    __empty_function,
    timeEnd: __empty_function
};

(No set with var)

this time work on IE, but Firefox, Opera, Safari, Google Chrome giving error. (Like "console variable is undefined")

Code:

var console = console || {                         // Yararlı bir Hata Yakalama Aracı: http://www.my-debugbar.com/wiki/CompanionJS
    log:     __empty_function, 
    debug:   __empty_function, 
    info:    __empty_function, 
    warn:    __empty_function, 
    error:   __empty_function,
    assert:  __empty_function,
    dirxml:  __empty_function,
    time:    __empty_function,
    timeEnd: __empty_function
};

Dont work IE and other browser. This should be work and should be override on new console variable.



Companion.JS 0.5 version and another information;

Companion.JS BHO loaded : OK
JS Debugger Thread running : OK
JS debugger version : OLD
JS Debugger connected : OK
Internet Explorer Version : 7.0.6001.18
Protected Mode : OFF

Last edited by Nickolas (2009-04-10 17:40:29)

Offline

 

#4 2009-04-10 18:00:18

fabrice
DebugBar Support
From: San Francisco, CA, USA
Registered: 2007-11-08
Posts: 1182
Website

Re: type definition of console variable

Ha. I'm not sure to understand : You code is working under IE but not under other browsers right ? In this case you should post on forums dedicated to those browsers.

Offline

 

#5 2012-01-13 16:04:53

Smith61
New member
Registered: 2011-08-26
Posts: 1

Re: type definition of console variable

hi! I found a site where you can find easy recipes. www.gourmetrecipe.com . Check it out! Its fun to cook!


cooking recipes
Gourmandia is a culinary website offering videos of world-class Michelin rated chefs exhibiting their techniques. Also features documentaries on fine dining restaurant locations and cities, recipes, forum, and more.

Offline

 

Partners : Debugbar | Mobilier de bureau | Debugbar Wiki | IEForge | Lampes design | La fourmi créative