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 8483341
In Process

The Archive Base Latest Questions

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

I am trying to load links in frames when am hovering them but is

  • 0

I am trying to load links in frames when am hovering them but is not working. If I use this function to any link that I create on the page is working but when i use it on dynamically created is not working.

This is the data that are created on the page

$('#user-tweets').append('<table class="tweets" width="320" border="0"><tr><td rowspan="1">' + 
  user + '</td><td rowspan="1">' + 
  date + '</td></tr><tr><td width="45"><a href="' + 
  profile_img + '"><img src="' + 
  profile_img + '" width="55" height="50"/></a></td><td width="186">' + 
  text + '<p><a href="' + url + '"target="_blank">' + 
  url + '</a></p></td></tr></table><hr>'
);

…and am using this function to open links into frames when i hover.

$("a").hover(
  function() {
    $(this).append($("<iframe src='"+this.href+"'></iframe>"));
  },
  function () {
    $(this).find("iframe:last").remove();
  }
);
  • 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-10T20:04:35+00:00Added an answer on June 10, 2026 at 8:04 pm

    You have to use a delegated event handler, using .on().

    $('#user-tweets').on('mouseenter', "a", function() {
        $(this).append($("<iframe src='"+this.href+"'></iframe>"));
    }).on('mouseleave', 'a', function () {
        $(this).find("iframe:last").remove();
    });
    

    The idea is that you bind the handler to some parent element which already exists at the time your script is being run. Then, the event triggered on the new content can bubble up the DOM tree to that parent and be handled there. Thus you can handle events on all elements matching a specific selector, even if they don’t yet exist.

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

Sidebar

Related Questions

I have an array of URL Links that I'm trying to load into a
I'm trying to use Javascript to load more links in my nav bar .
I am trying to load different pages into div when user clicks on links.
I'm trying to load different Google Maps depending on what link they click. Something
Trying to load a small .txt file into mysql but get all my data
I'm trying to figure out how to load the url each tab links to
Using javascript I'm trying to load images not on the current page (from an
I'm trying to loop through the results of a function that is returning an
Trying to figure out the best way to do this (And without crossing any
I am trying to load Skyscanner API dynamically but it doesn't seem to work.

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.