<a href="http://stackoverflow.com/" class="link" id="4" >stackoverflow</a>
<script>
$('.link').click(function(){
var idx = $(this).attr('id');
visit(idx);
})
</script>
I want to make a function run before browser opened.
The function visit() is defined and doesn't have error.
For some reason, visit(idx) is ignored.
Can anyone give me any hints?