I think you would need to define the function in the tag <script/>elsewhere.
It would be so simple to use something like:
<script type="text/javascript">
$('#something_link').click(function(e) {
e.stopImmediatePropagation();
});
</script>
<a href="something.html" id="something_link">Click me</a>
source
share