Team:TU-Munich/Project/Overview

From 2013.igem.org

(Difference between revisions)
Line 6: Line 6:
<!-- Star des Inhalts -->
<!-- Star des Inhalts -->
-
 
-
<span id="counter">0</span> [[Special:PopularPages|visitors]]
 
-
 
-
<html>
 
-
<script>
 
-
function render_counter(c) {
 
-
i = 0;
 
-
iid = window.setInterval(function(){
 
-
if ( (c-i) > (c/200) ) {
 
-
$('span#counter').html(i);
 
-
i += Math.round(c/200);
 
-
} else {
 
-
$('span#counter').html(c);
 
-
window.clearInterval(iid);
 
-
}
 
-
}, 10);
 
-
}
 
-
 
-
$(document).ready(function(){
 
-
$.ajax({
 
-
url: "https://2013.igem.org/Special:PopularPages",
 
-
success: function( html ) {
 
-
dom = $.parseHTML(html);
 
-
visitors = $(dom).find('a[title="Team:TU-Munich"]').parent().text();
 
-
visitors = visitors.substring(visitors.indexOf('(')+1);
 
-
visitors = visitors.substring(0, visitors.indexOf(' '));
 
-
visitors = visitors.replace(',', '');
 
-
render_counter(visitors);
 
-
},
 
-
error: function( xhr, status ) {
 
-
render_counter(4700);
 
-
}
 
-
});
 
-
});
 
-
</script>
 
-
</html>
 

Revision as of 16:33, 26 September 2013