si, in effetti sono un fesso.
Ho copiaincollato l'esempio modificando solo il path ai file.
La console mi da un syntax error che nel file originale non mi viene notificato nonostante il codice sia lo stesso:
}YAHOO.util.Event.addListener(window, "load", init);
eppure la sintassi è la stessa anche nell'esempio on-line (me lo da anche se carico la libreria event.js direttamente dal sito di yahoo invece che dal mio hdd).
Questo il prototipo della funzione in questione:
codice:
/**
* Appends an event handler
*
* @method addListener
*
* @param {Object} el The html element to assign the
* event to
* @param {String} sType The type of event to append
* @param {Function} fn The method the event invokes
* @param {Object} obj An arbitrary object that will be
* passed as a parameter to the handler
* @param {boolean} override If true, the obj passed in becomes
* the execution scope of the listener
* @return {boolean} True if the action was successful or defered,
* false if one or more of the elements
* could not have the event bound to it.
* @static
*/
addListener: function(el, sType, fn, obj, override)