PDA

Visualizza versione completa : [JS] Estrarre un valore dal codice di un tooltip


miciomao
27-12-2007, 21.57.04
Buonasera, su una cella di una tabella ho il seguente codice:



<th width="150"><a style="cursor: pointer;" onmouseover="
this.T_WIDTH=230;
this.T_OFFSETX=-120;
this.T_OFFSETY=-30;
this.T_STICKY=true;
this.T_TEMP=3000;
return escape('<table width='220'><tr><td class='c' colspan='2'>nick Bollicino</td></tr><tr><th width='45'><img src='http://www.avatarmobile.com/avatar.php?avatarm_id=5377cdedf3e068810a6891b12f97 413c' height='80' width='80'/></th><th style='text-align: left'><a href='?mode=info&start=3212'>Pos: 3212</a><br><br><a href='?mode=messages&option=write&id=31470'>Scrivi messaggio</a><br /><a href='?mode=buddy&option=apply&id=31470'>Richiedi inserimento</a></td></tr></table>');"><span class=w title=W>Bollicino</span></a></th>



Dovrei estrarre il nr di id utente contenuto nell' href mode=messages

Ho provato ad intercettarlo con il seguente codice ma non ci sono riuscito


mbid = parseInt(cells[4].getElementsByTagName('a')[2].getAttribute('href').match(/id=(\d+)/)[2]);



onestamente non so neanche se si puņ fare :crying: