$(document).ready(function() {
  setTab();
});

function setTab(){
  var url = window.location.href
  var lastSegment = "/" + url.split('/').pop();
  $(".navbar-nav li a").each(function() {
    if ($(this).attr('href') == lastSegment) {
      $(this).parent().addClass("active");
    }
  });
}

@@ -41,16 +41,62 @@
 );%0A%7D);%0A%0A
+// Set the correct tab%0A// ===================%0A
 function

Clean up application script