Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function do_the_bad_work() {
- var $$$ = jQuery;
- var _elms = $$$("#Table5 tbody tr:last-of-type ul:first-of-type table tbody tr");
- var _vec = _elms.toArray().slice(2);
- var _tot_faltas = 0;
- var _tot_aulas = 0;
- $$$.map(_vec, function (the_row) {
- _tot_faltas += parseInt($$$(the_row).find("td").eq(13).find("font").html());
- _tot_aulas += parseInt($$$(the_row).find("td").eq(14).find("font").html());
- });
- console.log("Frequência total: " + (100 - (((_tot_faltas*100.0)/_tot_aulas))) + "%");
- }
- if (!("jQuery" in window)) {
- console.info("jQuery ($) not defined");
- var k = document,
- c = k.createElement('script'),
- ref = k.getElementsByTagName('script')[0];
- c.type = "text/javascript";
- c.src = "http://code.jquery.com/jquery-1.9.1.min.js";
- c.onload = function () {
- console.warn("jQuery ($) defined");
- do_the_bad_work();
- }
- ref.parentNode.insertBefore(c, ref);
- }
- else
- do_the_bad_work();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement