$("a").click(function(){ do something // return false, this is jQuery's way of preventing default or bubbling return false; });
Hope this helps On Dec 16, 11:51 am, simshaun <simsh...@gmail.com> wrote: > I have a page where I am using jQuery's load function to inject HTML > into a div container. > > Right underneath the opening body tag, I've written a script that > binds an onClick event to all <a> tags. > The event fires e.preventDefault(), reads the href attribute, and > loads that href into a div container. > > At the bottom of the page, I've placed Google Analytics tracking code. > > Instead of loading the link's href into the div container, FireFox > actually tries to load the link as if I never used e.preventDefault(). > > IE seems to work OK though, (or handles it inappropriately and seems > to work fine.) > > The pages that are supposed to be loaded into the DIV container have > Google Analytics code as well. > Once I removed the Analytics code from those pages, everything works > fine. > > Why does having Google Analytics on pages loaded via the load function > cause everything to break?