1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
function affLiens(id){
var tab = new Array();
tab[0] = "http://www.google.ch/search?hl=fr&q=";
tab[1] = "http://www.altavista.com/web/results?itag=ody&q=";
for(var i=0;i<=tab.length-1;i++){
tab[i]+document.getElementById(id).value;
document.write(tab[0]); /*retourne la valeur "http://www.google.ch/search?hl=fr&q="*/
}
document.write(tab[0]);
/*ici ca me retourne encore la valeur de base de tab[0] http://www.google.ch/search?hl=fr&q= */
}
document.write(tab[1]); /* ne retourne absolument rien, le tableau n'est donc accessible qu'au sein de la fonction ? */ |
Partager