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

  • Home
  • SEARCH
  • 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 8429047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:13:34+00:00 2026-06-10T05:13:34+00:00

I have two files that are exact in coding, file A and B. Within

  • 0

I have two files that are exact in coding, file A and B. Within File A, there are links to create a popup of File B. At the top of file A, I created a link (a href) that, when clicked, alerts the user. This exact code is in file B. It works in file A, but not in file B.

    <a href="#" id="send-email">Send Email</a>

And the jQuery:

    $('#send-email').click(function(e) {
        alert('works');
    });

The curious thing is, they are all linked to the same external jQuery file, and every other jQuery function that is there works (eg, accordion menu), except this popup click. I tried using the jQueryUI first, but that’s how I discovered this issue; then I went down to just the barebones click-alert, and that’s the code I posted above.

Does .click work in pop-ups? If so, how?

  • 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-10T05:13:35+00:00Added an answer on June 10, 2026 at 5:13 am

    A pop up is really no different than any other page (except when you get into talking about session state and contexts in certain browsers, but that isn’t the issue here). click functions the same way in a pop up that it does in any other window. There are lots of things that could be causing your issue, though. Duplicate ID’s, missing/misspelled function, etc.

    So I can’t give you a definitive answer yet, but here’s a good step to debug it:

    instead of attaching a click event to it the way you’re doing it (note that your way is far more correct than my way, but my way aids in debugging), do it like this:

    <a href="#" onclick = "alert('works')" id="send-email">Send Email</a>
    

    If that doesn’t work, maybe you’re blocking pop-ups or something. It’s a problem with the alert. If it DOES work, try this:

    <a href="#" onclick = "AlertIt()" id="send-email">Send Email</a>
    

    with this elsewhere on your page:

    function AlertIt() {
    alert("worked");
    }
    

    If this works too, you’re more than likely looking at a problem loading jQuery or a jQuery conflict.

    Edit: oh, one more thing. Try using jQuery’s live function. This attaches the event handler to elements whether they exist already or not. click will only attach the event if the element already exists. It is possible that this is caused by the order of operations, so to speak, that you’re using.

    live looks like this:

    $("#send-email").live("click", function(){ alert("Worked"); });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two files: master/newsletter1/file.html master/newsletter2/file.html newsletter1/file.html has a lot of new changes that
Suppose i have one folder and inside that another two files are there .
I have two XML files that are generated by another application I have no
I have two text files that contain columnar data of the variety position -
Hi I have two text files that each contain different information about certain structures.The
I have these two simple files that define a C++ class with a tryME
I have two large (~100 GB) text files that must be iterated through simultaneously.
I have this c# web app that relies heavily on two dll files that
I have a program that compares two files. I ran visual studio analysis and
I wanted to write a program that test if two files are duplicates (have

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.