Bon, j'ai un petit soucis sur l'utilisation d'une fonction en appel à 2 paramètres:
dans le .js
un peu plus loin:
Quelqu'un peut m'expliquer ce qui ne colle pas? pourquoi j'ai un PlainClick not defined?
NB: I've tested also with or without quotes, put the function upper, ... nothing change.
dans le .js
Code: Select all
// TODO: Set up your game interface here, according to "gamedatas"
for ( var id in gamedatas.plaincards )
{
var card = gamedatas.plaincards[id];
var r = card.plain_row;
var c = card.plain_col;
var i = card.plain_card;
var s = card.plain_status;
if (s==-1) // Empty
dojo.style("p"+r+c, "backgroundPosition", "40px");
else
dojo.style("p"+r+c, "backgroundPosition", -(i *40) + "px");
// dojo.connect('p'+r+c,'onclick',this,'PlainClick('+r+','+c+')');
// dojo.connect('p'+r+c,'onclick','PlainClick('+r+','+c+')');
dojo.connect('p'+r+c,'onclick',PlainClick(r,c));
}
Code: Select all
///////////////////////////////////////////////////
//// Utility methods
/*
Here, you can defines some utility methods that you can use everywhere in your javascript
script.
*/
PlainClick: function (ROW,COL)
{
this.showMessage("Plain ="+ROW+COL, 'error' );
},
NB: I've tested also with or without quotes, put the function upper, ... nothing change.