title: jquery.unobtrusive-ajax plugin broken when updating to Jquery 1.9.0
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8021436/jquery-1-7-turning-live-into-on">jQuery 1.7 - Turning live() into on()</a>  </p>
  </blockquote>
  
  
  
  <p>//Solution: I simply replaced the four occurrences like the approved answer suggested and unobtrusive ajax plugin is up and working again with jquery 1.9.0</p>
  
  <p>Update//Observe the comments for the answer marked at the bottom which is the best way to solve this.</p>
  
  <p>//Original post:
  I upgraded to jQuery 1.9.0 but then unobtrusive ajax plugin went down since they deprecated the live method. I tried to replace it like this since the upgrade fixes an other bug for me. However, it does not work. I simply replaced live with on like this:</p>
  
  <pre><code>$("a[data-ajax=true]").on("click", function (evt) {
          evt.preventDefault();
          asyncRequest(this, {
              url: this.href,
              type: "GET",
              data: []
          });
      });
  
      $("form[data-ajax=true] input[type=image]").on("click", function (evt) {
          var name = evt.target.name,
              $target = $(evt.target),
              form = $target.parents("form")[0],
              offset = $target.offset();
  
          $(form).data(data_click, [
              { name: name + ".x", value: Math.round(evt.pageX - offset.left) },
              { name: name + ".y", value: Math.round(evt.pageY - offset.top) }
          ]);
  
          setTimeout(function () {
              $(form).removeData(data_click);
          }, 0);
      });
  
      $("form[data-ajax=true] :submit").on("click", function (evt) {
          var name = evt.target.name,
              form = $(evt.target).parents("form")[0];
  
          $(form).data(data_click, name ? [{ name: name, value: evt.target.value }] : []);
  
          setTimeout(function () {
              $(form).removeData(data_click);
          }, 0);
      });
  
      $("form[data-ajax=true]").on("submit", function (evt) {
          var clickInfo = $(this).data(data_click) || [];
          evt.preventDefault();
          if (!validate(this)) {
              return;
          }
          asyncRequest(this, {
              url: this.action,
              type: this.method || "GET",
              data: clickInfo.concat($(this).serializeArray())
          });
      });
  </code></pre>