The highlighted part of the JavaScript below is blocking the b4j_connect("/sales"). Why? When I take out the highlighted part, it connects and everything works.
JavaScript:
<script>
//connect to the web socket when the page is ready.
$(document).ready(function() {
var showHeaderAt = 150;
var win = $(window),
body = $('body');
// Show the fixed header only on larger screen devices
if(win.width() > 600){
// When we scroll more than 150px down, we set the
// "fixed" class on the body element.
win.on('scroll', function(e){
if(win.scrollTop() > showHeaderAt) {
body.addClass('fixed');
}
else {
body.removeClass('fixed');
}
});
}
var input = document.getElementById("searcher");
input.addEventListener("keyup", function(event) {
if (event.keyCode === 13) {
event.preventDefault();
b4j_raiseEvent(input.id + "_Enter", {});
}
});
var input2 = document.getElementById("card");
input2.addEventListener("click", function() {
b4j_raiseEvent(input2.id + "_Click", {});
});
b4j_connect("/sales");
});
</script>