Tu m'obliges à modifier le code (top secret, obligé de tuer après
).
Alors, du côté de l'HTML (je n'en suis pas responsable, mais obligé de travailler avec), c'est quelquechose du genre :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| <div id="infoTruc"><span class="thisisatooltip" title="
<table>
<tr id=infoTrucTr1>
<td>Partie 1</td>
<td>Partie 2</td>
<td>Partie 3</td>
</tr>
<tr id=infoTrucTr2>
<td colspan=3><hr id=infoTrucHr></td>
</tr>
</table>
<table>
<tr>
<td>Partie 1</td>
<td>Partie 2</td>
<td>Partie 3</td>
</tr>
<tr>
<td>Partie 1</td>
<td colspan=2>Partie 2</td>
</tr>
</table>
"><a href="lien.php?param1=2"><img src="image1.jpg" border="0"></a></span></div> |
Quant au code JS, en premier lieu, je recherche l'élément SPAN :
var monSpan = window.content.document.getElementById("infoTruc").firstChild;
Les différents appels pour trouver TITLE :
1 2 3
| alert(monSpan.title); // vide
alert(monSpan.style.title); // vide
alert(monSpan.getAttribute("title")); //vide |
En faisant :
1 2 3 4 5 6
| var atttt = monSpan.attributes;
for (x = 0 ; x < atttt.length; x++)
{
alert (atttt[x].name + "->" + atttt[x].value);
}
alert ("Taille : " + atttt.length); |
Je n'ai qu'un alert dans la boucle : "class->thisisatooltip". Et atttt.length vaut 1.
Et un alert( window.content.document.getElementById("infoTruc").innerHTML) retourne :
<span class="thisisatooltip"><a href="lien.php?param1=2"><img src="image1.jpg" border="0"></a></span>
Du coup, j'en suis venu à penser que ça venait de mooTools (utilisé dans la page HTML), puisqu'apparemment la classe "thisisatooltip" fait partie de cette lib JS.
PS : Je rappelle que le code JS est dans une extension Firefox.
Partager