Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9105181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:02:33+00:00 2026-06-17T02:02:33+00:00

I intercept all the click events in my iframe with this code: $(doc.body).on("click", function(e)

  • 0

I intercept all the click events in my iframe with this code:

$(doc.body).on("click", function(e) {
    if (e.from === undefined) {
        e.preventDefault();
        e.stopPropagation();
        interceptEvent(e);
    }
}

The interceptEvent(e) sends an XML message (with the path to the original e.target)
The message is caught (on another browser) by the function:

if (document.createEvent) { //Netscape
    var evt = document.createEvent("HTMLEvents");
    evt.initEvent(value, false, true);
    evt.from = 'trigger'; //trigger for recognize a XML programmatically event
    return !$('.browser').contents().find(path)[0].dispatchEvent(evt);
}

The objective of this function is to replicate the event.
To avoid loops (interception is active on other browsers too) I add to dispatchedEvent a the property "from".

Despite this the e.form is always undefined, where am I wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T02:02:34+00:00Added an answer on June 17, 2026 at 2:02 am

    Seems that you use jQuery, right?

    the jQuery event does not have a property from and only normalizes the following event properties:

    • target
    • relatedTarget
    • pageX
    • pageY
    • which
    • metaKey

    if you want to pass custom properties with the event you need to trigger your custom event with jQuery itself. http://api.jquery.com/category/events/event-object/ or access the original Event with event.originalEvent

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to intercept all the UI (touch/click etc) events in the
I need to intercept all the events triggered on a page and to stop
In order to add events we could use this simple first solution : function
My question is: Is there a way that I can intercept all button click
I've got this code from an example I found useful around Internet. It uses
I want to intercept all route changes with Sammy to first check if there
I need to intercept the calls to all the method calls to an Interface.
I just want to intercept raw data (hex)--headers and all--sent to a port, and
I've been searching for this answer all over internet but so far no luck.
I searched all over the internet and this site and I can't figure this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.