Difference between revisions of "Team:Czech Republic/Template:Scripts"

Line 24: Line 24:
 
<script>
 
<script>
 
window.onload = function(){
 
window.onload = function(){
    window.document.body.onload = doThis;
 
 
     var link = document.createElement('link');
 
     var link = document.createElement('link');
 
     link.type = 'image/x-icon';
 
     link.type = 'image/x-icon';
Line 30: Line 29:
 
     link.href = 'https://static.igem.org/mediawiki/2015/3/34/Czech_Republic_favicon.png';
 
     link.href = 'https://static.igem.org/mediawiki/2015/3/34/Czech_Republic_favicon.png';
 
     document.getElementsByTagName('head')[0].appendChild(link);
 
     document.getElementsByTagName('head')[0].appendChild(link);
};
+
    var paragraphs = document.getElementsByTagName("p");  
 
+
    var len = paragraphs.length;
function doThis() {
+
    for (var i = 0; i < len; i++) {
var paragraphs = document.getElementsByTagName("p");  
+
        var elem = paragraphs[i];
var len = paragraphs.length;
+
        if (elem.innerHTML.trim() == '<br>') {
for (var i = 0; i < len; i++) {
+
            elem.parentNode.removeChild(elem);
    var elem = paragraphs[i];
+
            i--;
    if (elem.innerHTML.trim() == '<br>') {
+
            len--;
        elem.parentNode.removeChild(elem);
+
        }
        i--;
+
        len--;
+
 
     }
 
     }
}
 
 
}
 
}
 
</script>
 
</script>

Revision as of 08:13, 10 September 2015