From: Alan Knowles Date: Tue, 27 Jul 2010 02:56:27 +0000 (+0800) Subject: Roo.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=34a327b7f544f29975c08039fc071a1343f3b95d Roo.js --- diff --git a/Roo.js b/Roo.js index 64b57429c7..32a317aff0 100644 --- a/Roo.js +++ b/Roo.js @@ -305,7 +305,20 @@ Roo.factory(conf, Roo.data); c.xns = false; // prevent recursion.. return c; }, - + /** + * Logs to console if it can. + * + * @param {String|Object} string + * @method log + */ + log : function(s) + { + if ((typeof(console) == 'undefined') || typeof(console.log) == 'undefined')) { + return; // alerT? + } + console.log(s); + + } /** * Takes an object and converts it to an encoded URL. e.g. Roo.urlEncode({foo: 1, bar: 2}); would return "foo=1&bar=2". Optionally, property values can be arrays, instead of keys and the resulting string that's returned will contain a name/value pair for each array value. * @param {Object} o