I have links such as:
<?php echo
anchor("$controller_name/cleanup",
'<i class="fa fa-undo hidden-lg fa fa-2x tip-bottom" data-original-title="'.lang('items_cleanup_old_items').'"></i><span class="visible-lg">'.lang("items_cleanup_old_items").'</span>',
array('id'=>'cleanup',
'class'=>'btn btn-warning','title'=>lang("items_cleanup_old_items")));
?>
I have javascript in $(document).ready()
that binds to the anchor and overrides the click to be an ajax call function and does event.preventDefault();
to prevent the link from being navigated to.
The problem I am running into is if the page is not loaded all the way yet and they click the link; they go to the ajax page (which is a bunch of json).
The solution I was thinking of is changing the anchor to javascript:void(0)
and adding a property data-cleanup-url with the actual link. Would this be a proper solution?