jquery - Intercept a click, make some actions and then propagate "click" again -


Good day all.

Today I was asked to develop a jquery tracking for some incidents on thousands of web pages.

I have to stop some clicks on clickable elements, make some calls, and then let the page continue to work as usual. For example, suppose there are some text inputs on the page, some checkboxes, some links and a submit button.

Do not ignore submit buttons for some time. I'll handle it later. I think something like this:

  $ (document) .ready (function () {$ ('input [type = button], input [type = submit], input [type = checkbox] ('Id: "+ + evt.target.id +", Category: "Bund (' click ', function (abt, check) {//evt.preventDefault (); console.log (" id: + Evt .target.class + ", name:" + evt.target.name); console.log (check); evt.target.trigger ('click', 'check');});});  

I had to use jquery 1.5, and nothing could be updated from this.

I guessed it could be on the forward side, but the error code comes in the above code:

  id: terms, class: undefined, name: Terms undefined // It's okay, the check variable will be used to differentiate real clicks from people triggered. Uncut Type Error: Object # & lt; HTMLInputElement & gt; No method 'trigger' (anonymous function) e jquery-1.5.min.js d.event.handle jquery-1.5.min.js j.handle.l jquery-1.5.min.js  
< P> Did I forget something ...? thank you in advanced.

  $ (evt.target) .triggers  

Evt.target does not have a jQuery cover on its own.

This is evident from the following line:

  object # & lt; HTMLInputElement & gt; 

Also, renew your version of jQuery. 1.5 is extremely dated, you've lost performance and key functions.


Comments