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

Forum Home


advanced search

You are not logged in.

Announcement

Forums are now closed as we moved them to google groups. You can use the following Google Groups to discuss about DebugBar and IETester products:

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

Nickolas
New member

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 13:52:03)

Offline

 

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

fabrice
DebugBar Support

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 15:37:29

Nickolas
New member

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 15:40:29)

Offline

 

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

fabrice
DebugBar Support

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