How to change
$.fn.ajaxFormPostLink = function() {
this.live('click', function() {
var $this = $(this);
...
to somenthig using .on() not .live(), i tried:
$.fn.ajaxFormPostLink = function() {
$("body").on('click', this, function() {
var $this = $(this);
...
but id does not work, so how to change live() to on() in jQuery plugin.
Rebuild the plugin to be used this way:
$.ajaxFormPostLink(".someform",{... options ...});
for example:
$.ajaxFormPostLink = function(selector,options) {
$(document).on("click",selector,function(){
...
});
};
Try this:
$("body").on('click', this.selector, function() {
Assuming you are dealing with simple jQuery object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With