how to determine the is in which the user clicked on with jQuery?

how to determine the is in which the user clicked on with jQuery?

Hi again

I have list of link
<a href="?id=1" class="test">enable user 1</a>
<a href="?id=2" class="test">enable user 2</a>
<a href="?id=3" class="test">enable user 3</a>
<a href="?id=4" class="test">enable user 4</a>


when I user click a link I create a dialog box using jQuery UI

like so


  1. <script>
  2. $(function($){    

  3. $( "#dialog-confirm" ).dialog({
  4. resizable: false,
  5. height:175,
  6. modal: true,
  7. autoOpen: false,
  8. buttons: {
  9. "Yes I am sure. Process": function(e) {
  10. console.log($.urlParam('url')); //I need to know the id here
  11. $( this ).dialog( "close" );
  12. },
  13. Cancel: function() {
  14. $( this ).dialog( "close" );
  15. }
  16. }
  17. });
  18. $('.decative').click(function(e) {
  19. $( "#dialog-confirm" ).dialog( "open" );
  20. e.preventDefault();
  21. });

  22. });
  23. </script>

i found this function to return the value of id
  1. $.urlParam = function(name){
  2.     var results = new RegExp('[\\?&amp;]' + name + '=([^&amp;#]*)').exec(window.location.href);
  3.     return results[1] || 0;
  4. }


Now, I just need to be able to tell what link did the user clicked on?

so if a user click on "enable user 1" I can send a json call to enable user.

I just need to be able to determine the URL id in line 10 of my code.

How can I do this?

Thanks