How can I ensure that a link's default action is always disabled?
<p>I'm working on a project where I'm using a lot of ajax calls to make the the site interaction more elegant.  The process I have been using is to have the link to the script that executes the appropriate action stored as the href in a link tag.  I then use jquery to target that element and disable the default action and execute the ajax call. </p>

<p>The problem is that on occasion the <code>$(document).ready()</code> function doesn't properly execute or is delayed in executing before a user can click the links.  This results in the page being opened via normal browser load.  </p>

<p>I have implemented code that detects if the code is being executed via ajax or via the browser so all that happens is that a blank page is loaded.  In some cases I can have it detect the execution type and respond differently but in other cases, if it's not executed by ajax then it causes problems.  </p>

<p>Is there a way to ensure that the link's default action is disabled at all times regardless of the page's loading progress or is there a better approach than the one I'm taking?</p>
