I suppose you want to add an event handler for all links, like this:
$(document).on('click', 'a', function() {
this.href = "javascript:intel.xdk.device.launchExternal('" + this.href + "');";
});
The job will be done only when the link is clicked.
Or, thanks to bencol:
$(document).on('click', 'a', function() {
javascript:intel.xdk.device.launchExternal(this.href);
return false;
});