I have a script like:
<script type="text/javascript">
$("a.link").on("click",function(){
window.open('http://site.com/fir.php','_self',false);
});
</script>
and I am using it as
<a href="fir.php" class="link">
fir
</a>
How can I make only one script and pass as variable the url I want to open?