il discorso è ke cosi' mi ordina i nomi e associa i link rispettivi pero' dovrei eliminare la prima parte ke nn mi serve
PER ELIMINARLA DEVO USARE QUESTI 2 METODIcodice:<script language="JavaScript"> <!-- hide var arLink = new Array(); arLink[0] = "http://**forumcommunity.net/?t=29243821"; arLink[1] = "http://***.forumcommunity.net/?t=29238227"; arLink[2] = "http://***.forumcommunity.net/?t=27017064"; arLink[3] = "http://***.forumcommunity.net/?t=27207644"; arLink[4] = "http://***t.forumcommunity.net/?t=28592243"; var arText = new Array(); arText[0] = "Fight Club"; arText[1] = "Requiem for a dream"; arText[2] = "Final Destination 1"; arText[3] = "Boys don't cry"; arText[4] = "Natural Born Killers"; var newarray= new Array(); for (var i=0; i<5; i++) { newarray[i]=arText[i]+" *" +"" + arText[i] + "" } newarray .sort(); var stringa =newarray .join(";"); <span style="color:008080">// Quando aumentano i link è necessario incrementare la condizione</span> for (var i=0; i<5; i++) { document.write(newarray[i]+ " "); } //--> </script>
indexOf(string,index);
substring(index1,indexlast);
OVVERO MI LEVA LA PARTE DA PRIMA DELL'*
PER FAR CIO' HO BISOGNO DI UN FOR KE MI CONTROLLI QUESTO
newarray[i]=arText[i]+" <----LINK--->"
+"" + arText[i] + ""
COSI' INFATTI L'OUTPUT è QUESTO
Boys don't cry *Boys don't cry
Fight Club *Fight Club
Final Destination 1 *Final Destination 1
Natural Born Killers *Natural Born Killers
Requiem for a dream *Requiem for a dream