is there a way to set a binding over, precedence?
I have a link like so:
<a href="" class="popItUp" data-track"stuff"> </a>
popItUp binds to take the url and open in a popup.
data-track is another binding that is used to send event tracking data.
Problem:
popItUp returns false, and the data-track binding is never fired. Is there a way to always make data-track run first by jQuery as it will always return true?
Thanks
Code
// Mixpanel Click Tracking
$('[data-track]').live('click', function () {
console.log('track it please');
});
$('.popItUp').popupWindow({height:300,width:600,centerBrowser:1});
popUpWindow is a plugin: http://swip.codylindley.com/popupWindowDemo.html
If
popItUphandler is bound first and if itreturns falsethendata-track bindingwill not be called. You need to binddata-track bindingfirst if at all you want to give it more precedence and not matter whatpopItUpdoes.Looking at your edited question,
data-track bindingis done usinglivewhich works on event bubbling mechanism. IfpopItUphandlerreturns falsethen it is not going to work. May be you can try to prevent default behavior usinge.preventDefault();of anchor instead of returning false inside thepopItUphandler.