How to hook into JavaScript event handler functions?












1















We get many libraries out there which have their own UI components. Along with such components, they also have their own set of JavaScript code that handles events performed on these components. For example, if I were to use a single page theme in a CMS like Wordpress, it would have some JavaScript that handled the click on main navigation links to perform that scroll animation.
As I work on Accessibility, I would like to have for instance, the keyboard focus also to jump to target element that has been just animated into view port. I would like to have something like elem.clickHandlers.append(function(e) {...}); so that I can have my function pushed at end to run once all event handlers on the elem have been executed. Or if I wanted my function to be called before, I would like to have something like elem.clickHandlers.prepend(...).
Is there any JavaScript API that allows me to do the above?










share|improve this question























  • Please visit the help center, take the tour to see what and How to Ask. Do some research, search for related topics on SO; if you get stuck, post a Minimal, Complete, and Verifiable example of your attempt, noting input and expected output.

    – mplungjan
    Nov 23 '18 at 9:20











  • So in fact you need a way to read and manipulate the order of all event listeners, but all that without the need of triggering the event?

    – yunzen
    Nov 23 '18 at 9:36













  • Check this out: Visual Event

    – yunzen
    Nov 23 '18 at 9:39











  • Thanks for that input. But Using that bookmarklet, I'm not getting the desired output. Rather it says only one event is attached to one display:none element.

    – sidnc86
    Nov 26 '18 at 5:57











  • Also I don't get any diagramatic out put for that single page. I am going through a Sharepoint page. I guess there should be events attached to fields like search for sure.

    – sidnc86
    Nov 26 '18 at 6:01
















1















We get many libraries out there which have their own UI components. Along with such components, they also have their own set of JavaScript code that handles events performed on these components. For example, if I were to use a single page theme in a CMS like Wordpress, it would have some JavaScript that handled the click on main navigation links to perform that scroll animation.
As I work on Accessibility, I would like to have for instance, the keyboard focus also to jump to target element that has been just animated into view port. I would like to have something like elem.clickHandlers.append(function(e) {...}); so that I can have my function pushed at end to run once all event handlers on the elem have been executed. Or if I wanted my function to be called before, I would like to have something like elem.clickHandlers.prepend(...).
Is there any JavaScript API that allows me to do the above?










share|improve this question























  • Please visit the help center, take the tour to see what and How to Ask. Do some research, search for related topics on SO; if you get stuck, post a Minimal, Complete, and Verifiable example of your attempt, noting input and expected output.

    – mplungjan
    Nov 23 '18 at 9:20











  • So in fact you need a way to read and manipulate the order of all event listeners, but all that without the need of triggering the event?

    – yunzen
    Nov 23 '18 at 9:36













  • Check this out: Visual Event

    – yunzen
    Nov 23 '18 at 9:39











  • Thanks for that input. But Using that bookmarklet, I'm not getting the desired output. Rather it says only one event is attached to one display:none element.

    – sidnc86
    Nov 26 '18 at 5:57











  • Also I don't get any diagramatic out put for that single page. I am going through a Sharepoint page. I guess there should be events attached to fields like search for sure.

    – sidnc86
    Nov 26 '18 at 6:01














1












1








1








We get many libraries out there which have their own UI components. Along with such components, they also have their own set of JavaScript code that handles events performed on these components. For example, if I were to use a single page theme in a CMS like Wordpress, it would have some JavaScript that handled the click on main navigation links to perform that scroll animation.
As I work on Accessibility, I would like to have for instance, the keyboard focus also to jump to target element that has been just animated into view port. I would like to have something like elem.clickHandlers.append(function(e) {...}); so that I can have my function pushed at end to run once all event handlers on the elem have been executed. Or if I wanted my function to be called before, I would like to have something like elem.clickHandlers.prepend(...).
Is there any JavaScript API that allows me to do the above?










share|improve this question














We get many libraries out there which have their own UI components. Along with such components, they also have their own set of JavaScript code that handles events performed on these components. For example, if I were to use a single page theme in a CMS like Wordpress, it would have some JavaScript that handled the click on main navigation links to perform that scroll animation.
As I work on Accessibility, I would like to have for instance, the keyboard focus also to jump to target element that has been just animated into view port. I would like to have something like elem.clickHandlers.append(function(e) {...}); so that I can have my function pushed at end to run once all event handlers on the elem have been executed. Or if I wanted my function to be called before, I would like to have something like elem.clickHandlers.prepend(...).
Is there any JavaScript API that allows me to do the above?







javascript function hook






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 23 '18 at 9:17









sidnc86sidnc86

13410




13410













  • Please visit the help center, take the tour to see what and How to Ask. Do some research, search for related topics on SO; if you get stuck, post a Minimal, Complete, and Verifiable example of your attempt, noting input and expected output.

    – mplungjan
    Nov 23 '18 at 9:20











  • So in fact you need a way to read and manipulate the order of all event listeners, but all that without the need of triggering the event?

    – yunzen
    Nov 23 '18 at 9:36













  • Check this out: Visual Event

    – yunzen
    Nov 23 '18 at 9:39











  • Thanks for that input. But Using that bookmarklet, I'm not getting the desired output. Rather it says only one event is attached to one display:none element.

    – sidnc86
    Nov 26 '18 at 5:57











  • Also I don't get any diagramatic out put for that single page. I am going through a Sharepoint page. I guess there should be events attached to fields like search for sure.

    – sidnc86
    Nov 26 '18 at 6:01



















  • Please visit the help center, take the tour to see what and How to Ask. Do some research, search for related topics on SO; if you get stuck, post a Minimal, Complete, and Verifiable example of your attempt, noting input and expected output.

    – mplungjan
    Nov 23 '18 at 9:20











  • So in fact you need a way to read and manipulate the order of all event listeners, but all that without the need of triggering the event?

    – yunzen
    Nov 23 '18 at 9:36













  • Check this out: Visual Event

    – yunzen
    Nov 23 '18 at 9:39











  • Thanks for that input. But Using that bookmarklet, I'm not getting the desired output. Rather it says only one event is attached to one display:none element.

    – sidnc86
    Nov 26 '18 at 5:57











  • Also I don't get any diagramatic out put for that single page. I am going through a Sharepoint page. I guess there should be events attached to fields like search for sure.

    – sidnc86
    Nov 26 '18 at 6:01

















Please visit the help center, take the tour to see what and How to Ask. Do some research, search for related topics on SO; if you get stuck, post a Minimal, Complete, and Verifiable example of your attempt, noting input and expected output.

– mplungjan
Nov 23 '18 at 9:20





Please visit the help center, take the tour to see what and How to Ask. Do some research, search for related topics on SO; if you get stuck, post a Minimal, Complete, and Verifiable example of your attempt, noting input and expected output.

– mplungjan
Nov 23 '18 at 9:20













So in fact you need a way to read and manipulate the order of all event listeners, but all that without the need of triggering the event?

– yunzen
Nov 23 '18 at 9:36







So in fact you need a way to read and manipulate the order of all event listeners, but all that without the need of triggering the event?

– yunzen
Nov 23 '18 at 9:36















Check this out: Visual Event

– yunzen
Nov 23 '18 at 9:39





Check this out: Visual Event

– yunzen
Nov 23 '18 at 9:39













Thanks for that input. But Using that bookmarklet, I'm not getting the desired output. Rather it says only one event is attached to one display:none element.

– sidnc86
Nov 26 '18 at 5:57





Thanks for that input. But Using that bookmarklet, I'm not getting the desired output. Rather it says only one event is attached to one display:none element.

– sidnc86
Nov 26 '18 at 5:57













Also I don't get any diagramatic out put for that single page. I am going through a Sharepoint page. I guess there should be events attached to fields like search for sure.

– sidnc86
Nov 26 '18 at 6:01





Also I don't get any diagramatic out put for that single page. I am going through a Sharepoint page. I guess there should be events attached to fields like search for sure.

– sidnc86
Nov 26 '18 at 6:01












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53443705%2fhow-to-hook-into-javascript-event-handler-functions%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53443705%2fhow-to-hook-into-javascript-event-handler-functions%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

Tangent Lines Diagram Along Smooth Curve

Yusuf al-Mu'taman ibn Hud

Zucchini