Why is the result of clicking an <a> link unexpected? Is Javascript required to use your website? If so, then it may be in your interest to make those links work without javascript. Then you would use Javascript to enhance the static pages. That way users without Javascript (including search engines if it's a public site) can access your site.
-Hector On Sat, Mar 21, 2009 at 6:24 PM, Brad <[email protected]> wrote: > > Other have offered solutions where you hide the links, etc. > A variation of that theme would be to originally display the links > with some inline JS, e.g., > > <a href="mysite.html" onclick="myPrematureClickSentinel()"> > > Where myPrematureClickSentinel simply returns false. > > In your document.ready() > > $("a").removeAttr("onclick"); // get rid of all > myPrematureClickSentinel > $("a").click( function() { > // your actual click handler goes here. > }); > > You could chain those if you want. > > Of course as James pointed out this will not work if the user has JS > turned off... > > On Mar 20, 9:48 am, HippieX <[email protected]> wrote: > > I have a problem I am sure others have encountered. I have .click() > > events attached to <a> links in my web page, but the user is clicking > > the links before the document.ready(); fires causing unexpected > > results. Is there anyway to stop this from happening? > > > > Thanks, > > > > Jeff >

