very jquery noob

very jquery noob

I am very new to jquery (just a few days) so please be gentle.

i have a series of hrefs that all have the id link

i am trying to use jquery to load ajax views when each of the links are clicked.

I would like to reuse the function of each href passing in the params I need

for example:

  1. <a href="" id="link" l_view="view1.php" div_id="main_content">Click Here For View 1</a>
    <a href="" id="link" l_view="view2.php" div_id="main_content">Click Here For View 2</a>
my jquery looks like this currently.


  1. $('#link').click(function(){
  2. var view = $('#link').attr('l_view');
  3.         var div_id = $.('#link').attr('div_id');
  4.         alert(div_id);
  5.         return false;
  6.     });

I have not added the ajax stuff yet, just trying to get the function to accept the correct params first.
The jquery code works just fine when there is only 1 link on the page that has the ID of link. How do I get this function to be resuable with jquery?

Thanks again for any help.. like I said I am new jquery .. please be gentle to my utter noobishness.

Thanks,
P