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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:41:56+00:00 2026-05-30T05:41:56+00:00

I have a jQuery issue I can’t get past: (function ($) { var links

  • 0

I have a jQuery issue I can’t get past:

(function ($) {
var links = new Array();
var vidFrame = document.getElementById('videoFrame');
links = $('.video');

$(links).each(function() {
    $(this).bind('mouseenter', function() {
         $(vidFrame).attr('src',$(this).attr('href'));        
       window.frames[0].location.reload();
});
});

}(jQuery));

vidFrame is an iframe, links is a collection of links that (right now) link back to some content. I’m trying to get the click event assigned to each link so that mousing over that link broadcasts its source video into the iframe. I want to leave the original link info in the a href so that if JavaScript is disabled, the links just take you to the content instead.

The window.frames statement supposedly reloads the iframe but I haven’t got far enough to test it.

The script gets the right href, it just doesn’t bind it properly. I think the $(this) statement is scoped correctly, I was logging to the console and getting the links I wanted, but for some reason the events don’t bind?

This is an area I’ve had trouble with before, specifically mixing JavaScript and jQuery within the each() loop. I’d really be into any insight.

  • 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-05-30T05:41:57+00:00Added an answer on May 30, 2026 at 5:41 am

    There are a few things to point out in your code. You declare links as an array, the you overwrite it with a collection of jQuery objects and you double wrap it in a jQuery object when you call the each() loop… doesn’t make much sense.

    To call an event you don’t need an each() loop, you can just call it on the jQuery collection. The two $(this) you’re using inside the loop are misleading, you should cache it first thing like var that = $(this). Also, bind() is no longer used. You can use on() or the click() shortcut.
    The iframe should refresh when you pass in the new src. Take a look at Ajax Reload iframe.

    var $links = $('.video'),
        $frame = $('#videoFrame');
    
    $links.mouseenter(function(){
        $frame.attr('src', $(this).attr('href'));
    }); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an issue I can't get over. I made a simple jQuery album
Can anyone help? I have an issue with calling a asp.net webservice from jquery..
I have what seems to be a simple issue. I have a jquery function
I have an issue regarding to auto populating a select dropdown from jQuery/JSON data
I have this strange issue with my web app. You see, I'm using jQuery
I have a problem with the jQuery UI Slider. The issue also appears on
I am learning JQuery, and I have ran into an odd issue. I made
Another jQuery issue... I have tried this several times using class and id elements
I have been struggling with what I feel is a simple JQuery selector issue,
I have a jquery that has first server function call using post and next

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.