jquery-1.7

Getting Error “Form submission canceled because the form is not connected”

放肆的年华 提交于 2019-11-26 05:58:18
问题 I have an old website with JQuery 1.7 which works correctly till two days ago. Suddenly some of my buttons do not work anymore and, after clicking on them, I get this warning in the console: Form submission canceled because the form is not connected The code behind the click is something like this: this.handleExcelExporter = function(href, cols) { var form = $(\'<form method=\"post\"><input type=\"submit\" /><input type=\"hidden\" name=\"layout\" /></form>\').attr(\'action\', href); $(\'input

What&#39;s the difference between jQuery .live() and .on()

我的未来我决定 提交于 2019-11-26 01:39:40
问题 I see there\'s a new method .on() in jQuery 1.7 that replaces the .live() in earlier versions. I\'m interested to know the difference between them and what the benefits are of using this new method. 回答1: It's pretty clear in the docs why you wouldn't want to use live. Also as mentioned by Felix, .on is a more streamline way of attaching events. Use of the .live() method is no longer recommended since later versions of jQuery offer better methods that do not have its drawbacks. In particular,

Turning live() into on() in jQuery

时光怂恿深爱的人放手 提交于 2019-11-25 21:53:14
问题 My application has dynamically added Dropdowns. The user can add as many as they need to. I was traditionally using jQuery\'s live() method to detect when one of these Dropdowns was change() ed: $(\'select[name^=\"income_type_\"]\').live(\'change\', function() { alert($(this).val()); }); As of jQuery 1.7, I\'ve updated this to: $(\'select[name^=\"income_type_\"]\').on(\'change\', function() { alert($(this).val()); }); Looking at the Docs, that should be perfectly valid (right?) - but the