title: Call prototype(javascript) function on link click?
body: <p>I am working with AJAX with prototype and PHP. It is working for me but I need some small changes. Following is my running code for AJAX request:</p>
  
  <p><strong>JS/Prototype:</strong></p>
  
  <pre><code>function ajaxRequest(url) {
  
      new Ajax.Request( url, {
  
            method: 'get',
            onSuccess: function( transport ) {
  
              // get json response
              var json = transport.responseText.evalJSON( true );
              alert(json);
          },     
          onFailure: function() {             
              alert('Error with AJAX request.'); 
          }  
      });
  
      return false;
  }
  </code></pre>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;a href='javascript:ajaxRequest("/testajax/ajaxresponse");'&gt;Testing AJAX&lt;/a&gt;
  </code></pre>
  
  <p><strong>Question:</strong></p>
  
  <p>Now I want to change my link like this:</p>
  
  <pre><code>&lt;a href='/testajax/ajaxresponse' class='AjaxLink'&gt;Testing AJAX&lt;/a&gt;
  </code></pre>
  
  <p>So prototype function should capture click event of <code>class='AjaxLink'</code> links and then get href part of clicked link and proceed. How can I change my above prototype function for such kind of links.</p>
  
  <p>Thanks</p>