HighDots Forums  

Estrarre un valore dal codice di un tooltip

Javascript (Italian) Il linguaggio JavaScript (it.comp.lang.javascript)


Discuss Estrarre un valore dal codice di un tooltip in the Javascript (Italian) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
miciomao
 
Posts: n/a

Default Estrarre un valore dal codice di un tooltip - 12-27-2007 , 03:00 PM






Buonasera NG, su una cella di una tabella ho il seguente codice:

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

codice:

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



onestamente non so neanche se si può fare :\

Grazie
sandro

Reply With Quote
  #2  
Old   
Cristiano Larghi
 
Posts: n/a

Default Re: Estrarre un valore dal codice di un tooltip - 12-28-2007 , 04:31 AM






Il Thu, 27 Dec 2007 13:00:53 -0800 (PST), miciomao ha scritto:

Quote:
th width="150"><a style="cursor: pointer;" onmouseover="
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]);
sopra onmouseover restituisci una stringa (return escape('table ...). é
quindi una semplice stringa, non fa parte del DOM ...
Cosa fa questo onmouseover, scusa? non riesco ad immaginarmelo ...

spiega il contesto.

--
"E' l' ignoranza che crea l'intolleranza
di gente cieca e senza coscienza"
S.S.S.


Reply With Quote
  #3  
Old   
miciomao
 
Posts: n/a

Default Re: Estrarre un valore dal codice di un tooltip - 01-02-2008 , 04:39 AM



scusa se rispondo solo ora, onmouseover apre il tooltip.....
perdonami ma non mi sono mai cimentato in JS :\

Reply With Quote
  #4  
Old   
Cristiano Larghi
 
Posts: n/a

Default Re: Estrarre un valore dal codice di un tooltip - 01-02-2008 , 04:45 AM



Il Wed, 2 Jan 2008 02:39:14 -0800 (PST), miciomao ha scritto:

Quote:
scusa se rispondo solo ora, onmouseover apre il tooltip.....
cosa sarebbe questo "tooltip"? L'unico "tooltip" "insito" in html è la
proprietà title (o alt). Quindi, a naso, stai usando un qualcosa di già
fatto => come facciamo a capire come funziona?

--
"Ti sei salvato
o sei entrato in banca pure tu?"
A.V.


Reply With Quote
  #5  
Old   
miciomao
 
Posts: n/a

Default Re: Estrarre un valore dal codice di un tooltip - 01-02-2008 , 07:47 AM



mmmm.... giusto

il qualcosa di già fatto dovrebbe essere questo:

http://www.ugamela.com/scripts/wz_tooltip.js

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.