title: Jquery set onclick null and change button image on ajax succes
body: <p>i have an ajax function for uploading photos, and this function is executed onclick. 
  What i want is to delete the onclick event on succes, and to change the button style, in the uploadPhoto. How can this be done?      </p>
  
  <pre><code>  function uploadPhoto(image_path, message){
          var data = {
              "image_path": image_path,
              "message": message
          };
          var url = 'upload_photo.php';
          $.ajax({
              type: 'POST',
              url: url,
              data: data,
              async: true,
              dataType: 'json',
              success: function(response) {
                      //alert(response.code);
                    }
                  });
      }
  
  
  
        &lt;a href="#" onclick="uploadPhoto('/images/blah.jpg', 'something'); return false;"&gt;&lt;img style = "padding-top: 15px; padding-left: 125px;" src= "images/posteaza_pe_wall.png"&gt;&lt;/a&gt;
  </code></pre>