Re: [JSMentors] Wrapper for console in IE

2011-04-08 Thread Peter Higgins
Dojo has had a supplement console wrapper (and shipped firebuglite) for 
some years now:


{{{

//Be careful to leave 'log' always at the end
var cn = [
"assert", "count", "debug", "dir", "dirxml", "error", "group",
"groupEnd", "info", "profile", "profileEnd", "time", "timeEnd",
"trace", "warn", "log"
];
var i = 0, tn;
while((tn=cn[i++])){
if(!console[tn]){
(function(){
var tcn = tn+"";
console[tcn] = ('log' in console) ? function(){
var a = Array.apply({}, arguments);
a.unshift(tcn+":");
console["log"](a.join(" "));
} : function(){}
console[tcn]._fake = true;
})();
}
}

}}}

FirebugLite has come a long way over the years, too. You can  iirc.


~phiggins

On 4/8/11 10:58 AM, Jeremy Solarz wrote:

Yeah of course this would be a solution.

Was just interested if their exist some common solutions which are 
driven by the community.


Thanks anyway

On Fri, Apr 8, 2011 at 4:00 PM, Rob Griffiths > wrote:


I don't use it, I tend to just litter my code with console.log.
This has however bitten me several times. Especially with IE. As
Andrew says write your own wrapper if you want.

Or add
var console;
if (!console) console = {log: function() {}}

making console.log a no op on systems that don't have it.

-- 
Rob Griffiths

http://bytespider.eu

On Friday, 8 April 2011 at 14:54, Jeremy Solarz wrote:


Yeah I also found that one first,

but are any of you people actually using this?

If so how is your experience with it.

On Fri, Apr 8, 2011 at 3:18 PM, Rob Griffiths mailto:r...@bytespider.eu>> wrote:

Jeremy,

Checkout Ben Alman's Debug.
http://benalman.com/projects/javascript-debug-console-log/


-- 
Rob Griffiths

http://bytespider.eu

On Friday, 8 April 2011 at 14:14, Jeremy Solarz wrote:


Hi folks,

it seems that this question has never been asked, but do you
know a good wrapper for firefoxs, chromes
console.log function.

In case IE dev tools are not activated you get an error calling
console.log.

Sometimes it happens to me that I forget to remove the
console.log before pushing content to live.

How are you dealing with this.

A good solution for me would include cross browser support and
a centralized on/off switch for
debugging in JS

Regards

Jeremy
-- 
To view archived discussions from the original JSMentors

Mailman list: http://www.mail-archive.com/jsmentors@jsmentors.com/

To search via a non-Google archive, visit here:
http://www.mail-archive.com/jsmentors@googlegroups.com/

To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com



-- 
To view archived discussions from the original JSMentors Mailman

list: http://www.mail-archive.com/jsmentors@jsmentors.com/

To search via a non-Google archive, visit here:
http://www.mail-archive.com/jsmentors@googlegroups.com/

To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com





-- 
DI Jeremy Solarz

Spittelauer Laende 9/Top 12
1090 Wien

Mobil: +43 699 17 14 33 63
e-mail: jeremy.sol...@gmail.com 
-- 
To view archived discussions from the original JSMentors Mailman

list: http://www.mail-archive.com/jsmentors@jsmentors.com/

To search via a non-Google archive, visit here:
http://www.mail-archive.com/jsmentors@googlegroups.com/

To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com



-- 
To view archived discussions from the original JSMentors Mailman

list: http://www.mail-archive.com/jsmentors@jsmentors.com/

To search via a non-Google archive, visit here:
http://www.mail-archive.com/jsmentors@googlegroups.com/

To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com





--
DI Jeremy Solarz
Spittelauer Laende 9/Top 12
1090 Wien

Mobil: +43 699 17 14 33 63
e-mail: jeremy.sol...@gmail.com 
--
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/jsmentors@jsmentors.com/


To search via a non-Google archive, visit here: 
http://www.mail-archive.com/jsmentors@googlegroups.com/


To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com


--
To view archived discussions from the original JSMentors Mailman list:

Re: [JSMentors] Calling minified functions

2011-03-15 Thread Peter Higgins
I think he wants the function to be aware of the page it was included 
from. Eg:


page1.html
var infos = { url:"bar.php" }


page2.html
var infos = { url:"baz.php" }