Template:UCSF/Header

From 2010.igem.org

(Difference between revisions)
Line 82: Line 82:
for (var i=0;i<toBeTOCced.length;i++) {
for (var i=0;i<toBeTOCced.length;i++) {
var tmp = document.createElement('a');
var tmp = document.createElement('a');
-
                 var reg = /<span class=\"mw-headline\">([^/]+)\/span>/;
+
                 var reg = /<b>([^<]+)<\/b>/;
                 var str = toBeTOCced[i].innerHTML;
                 var str = toBeTOCced[i].innerHTML;
                 var result =  reg.exec(str);
                 var result =  reg.exec(str);
-
                alert(result);
+
tmp.innerHTML = toBeTOCced[i].firstChild.innerHTML;//result[1];
-
                if(result.length==3){tmp.innerHTML = result[2];}
+
-
else{tmp.innerHTML = result[1];}
+
tmp.className = 'page';
tmp.className = 'page';
z.appendChild(tmp);
z.appendChild(tmp);

Revision as of 07:06, 10 October 2010