javascript - jQuery 2.1 trigger extraParameters not work -


Why not pass additional parameters, as should be in accordance with the documentation?

The same code works correctly jQuery 1.8

  & lt; Input type = "checkbox" name = "test" value = "qqq" & gt; $ ('Input [value = "qqq"]'). On ('click', function (event, data) {warning (data);}); $ ('Input [value = "qqq"]'). Trigger ('click', ['QQQ']);  

Example of work behavior in jQuery 1.8:

UPD1: My solution to this problem:

  $ ('input [value] ('Click', function (event, data) {warning (data); if (data! = Zero) $ (this) .prop ('check',! $ (This) prop ('check'))}) ; $ ('Input [value = "qqq"]'). Trigger handler ('click', ['QQQ']);  

You will need to use the 'Change' event instead of 'Click'.

$ ('input [value =" qqq "]') On ('change', function (event, data) {warning (date );}); $ ( 'Input [value = "qqq"]'). Trigger ( 'change', [ 'QQQ']);

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -