J'essaie de trouver plusieurs types de texte différents dans un innerhtml, d'une certaine manière, il ne trouve rien, mais quand je l'ai testé avec les mêmes fonctions et un échantillon de test cela fonctionne.javascript ne peut pas effectuer une recherche via innerHTML
function numberoftext (a){if (a.match(/class=\"chattext\"/g)!==null){return a.match(/class=\"chattext\"/g).length;}else{return 0;}}
function numberofglobal (a){if (a.match(/class=\"chattextglobal\"/g)!==null){return a.match(/class=\"chattextglobal\"/g).length;}else{return 0;}}
function numberofclan (a){if (a.match(/class=\"chattextclan\"/g)!==null){return a.match(/class=\"chattextclan\"/g).length;}else{return 0;}}
function numberofgroup (a){if (a.match(/class=\"chattextgroup\"/g)!==null){return a.match(/class=\"chattextgroup\"/g).length;}else{return 0;}}
function numberofwisper (a){if (a.match(/class=\"chattextwhisper\"/g)!==null){return a.match(/class=\"chattextwhisper\"/g).length;}else{return 0;}}
function numberofworld (a){if (a.match(/class=\"worldsay\"/g)!==null){return a.match(/class=\"worldsay\">/g).length;}else{return 0;}}
function numberofscream (a){if (a.match(/class=\"chattextscream\"/g)!==null){return a.match(/class=\"chattextscream\"/g).length;}else{return 0;}}
var innertextraw1 =chatupdateFrame.document.documentElement.innerHTML;
var innertextraw= innertextraw1.substring(innertextraw1.indexOf("parent.chattextFrame.add(")+26, innertextraw1.indexOf("', 0);"));
console.log("got update",innertextraw);
console.log("t:",numberoftext(innertextraw),"c:",numberofclan(innertextraw),"w:",numberofwisper(innertextraw),"gr:",numberofgroup(innertextraw),"gl:",numberofglobal(innertextraw),"sc:",numberofscream(innertextraw));
un exemple pour innertextraw est: "<p class=\"chattext\"><i><b>noone</b> goes with <b>someone</b> to the house</i></p>"
test comme that fonctionne très bien aussi quand je mis innertextraw à l'exemple que je suis arrivé dans le journal de la console, sur le site, il retourne juste 0.