(function() {
function initProductImag ePanels() {
var elements = YAHOO.util.Dom. getElementsByCl assName('produc tImage',
'img');
for(var i = 0; i < elements.length ; i++) {
var el = new YAHOO.util.Elem ent(elements[i]);
var fnCallback = function(e, obj) {
var productImagePan el = new
YAHOO.com.mydom ain.widget.Prod uctImagePanel(o bj.get('name')) ;
productImagePan el.initWithSkuC ode(obj.get('na me'));
};
YAHOO.util.Even t.addListener(e lements[i], "click", fnCallback, el);
}
}
YAHOO.util.Even t.addListener(w indow, "load", initProductImag ePanels);
})();
---------------------
at work we're starting to use yahoo's YUI framework
(http://developer.yahoo.com/yui/) now I know Javascript fairly well, but
now we're doing this in conjunction with JSON.. we're using code like
above... I'm not familiar with this kind of syntax.. (a function
declared inside parens, etc..) are there any tutorials out there for
this kind of JavaScript syntax?
and this is nothing, am working also with this one,
http://www.mayacove.com/js/div.js.. and SOMEWHERE in this code is
something that is causing a weird error in IE, namely:
unexpected call to method or property access
(no erros in FF..)
and since I'm not familiar with this kind of code (was written by
someone else where I work) I'm having a hard time debugging it.. I would
like not just to solve this problem but in general to learn syntax of
this new kind of code from the ground up... would like to find
tutorials, etc.. where I can familiarize myself w/this syntax..
thank you very much...
Comment