jQuery BBQ noob question: I have downloaded jQuery BBQ 1.2.1 and I'm trying to use it with jQuery 2.1.0. BBQ works in the sense that it does what I want it to do, but I've noticed an error message in the console. I've tracked it down to what appears to be a compatibility issue. Here's a sample HTML page that produces the error:
<!DOCTYPE HTML>
<html>
<head>
<title>example</title>
</head>
<body>
example
</body>
<script src="../js/lib/jquery-2.1.0.min.js"></script>
<script src="../js/lib/jquery.ba-bbq.min.js"></script>
</html>
In Firefox the console error is TypeError: f is undefined
. In Chrome the error is different: Uncaught TypeError: Cannot read property 'msie' of undefined
.
I've noticed jQuery BBQ is pretty old. Is there a newer rev of jQuery BBQ? Or is there some newer replacement library?
UPDATE
I'm using jQuery BBQ because a google search sent me to this previously answered question: Parsing URL hash/fragment identifier with JavaScript. The real issue I'm trying to solve is the same as the linked question: to respond to changes in the hash portion of the URI and to parse that fragment.
It turns out that for my purposes (so far), I can eliminate jQuery BBQ and write a couple of lines of code to grab the hash string (and remove the hash sign):
$(window).bind('hashchange', function() {
var hashString = window.location.hash || '';
hashString = hashString.replace("#",'');
myEventHandler(hashString);
});
So that will work for now. It's pretty simple and it's one less module dependency, so win-win. I suppose that's why there were no responses to a jQuery-BBQ question, eh?