> Nessun problema, mi dà la possibilità di practicare il mio
> italiano. ;-)
Finalmente qualcuno che parla un pò la mia lingua :D!!
(Finally someone who speaks a little bit my language)
> (For non-Italian speakers: it's the usual answer about preserving
> `this`.)
perchè hai riscritto in inglese la mia richiesta? Non si capiva
nulla :) ?... Devo migliorare il mio inglese :(
(Why did you have rewrite in English my request? My request was
incomprehensible :D? ... I must improve my English :( )
> Con Function#bind:
> * * * *
> makeDroppable: function(elem, class) {
> Droppables.add(elem, {
> accept: class,
> onDrop: (function(dragged, dropped) {
> this.aggiungiGiocatore();
> }).bind(this)
> });},
>
> * * * *
grazie ho risolto questo con Function#bind.
( thanks I solved this by Function # bind)
Adesso però ho un problema simile, in un'altra parte del codice, che
ho risolto con un closure.
Vorrei sapere se è possibile anche in questo caso utilizzare la
Function#bind.
(But now I have a similar problem in another part of the code, which I
solved by a closure.
Would I know if is possible to resolve this with the Function # bind)
-----------------------------------------------------------------------
var Formazione = Class.create({
initialize: function(){
this.formazione = {};
...
closure = this;
},
inCampo: function(){
...
$(idDiv).observe( 'click', this.inTribuna );
},
inTribuna: function(event){
idCalc = this.id
...
closure.formazione = closure.cancellaGiocatore(idCalc);
});
-----------------------------------------------------------------------
In questo caso potrei usare Function#bind?
(can I use Function#bind in this case?)
> (Devo practicare il mio italiano di piu, ho avuto usare Google per
> trovare alcuni dei frasi e parole. :-( )
A chi lo dici, anch'io ho dovuto utilizzare Google :(
(...., I also had to use Google :( )
grazie mille
(thanks so much)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---