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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:04:51+00:00 2026-05-23T12:04:51+00:00

This piece of code works for every browser except IE7. In IE7, the user

  • 0

This piece of code works for every browser except IE7. In IE7, the user is redirected to http://www.youtube.com. Oh, and it doesn’t just redirect the frame, the entire page is redirected! Any thoughts? Ideas? Alternate patterns?

Please help me. IE is killing my will to live.

  $('.youtube .cue a').live('click', function(e) {
    e.preventDefault();
    var $this = $(this);
    var $area = $this.parents('.youtube');
    var $caption = $area.find('.videoDescription');
    var $li = $this.parents('li:first');
    var vid = $.trim($(this).attr('href').replace('#', ''));
    var title = $li.find('.title').text();
    var time = $li.find('.time').text();
    var description = $li.find('.description').text();

    var $frame = $('<iframe></iframe>').attr({
      width:595,
      height:350,
      frameborder: 0,
      src: 'http://www.youtube.com/embed/' + vid
    });

    if (!hasFlash) {
      $area.find('.captioned').html('<a href="http://get.adobe.com/flashplayer/" class="no-flash">Please install Flash</a>.');
    }
    else {
      $area.find('.captioned').html('').append($frame);
    }

    $caption.find('.title').html(title);
    $caption.find('.time').html(time);
    $caption.find('.description').html(description);
  });
  • 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-23T12:04:51+00:00Added an answer on May 23, 2026 at 12:04 pm

    It looks to me like this line:

    var vid = $.trim($(this).attr('href').replace('#', ''));
    

    is the problem. Retrieving the href from the <a> tag is going to return a fully qualified URL (including http:// and domain on the front). Then, in this line, you’re going to add it onto the end of another fully qualified URL:

    src: 'http://www.youtube.com/embed/' + vid
    

    That’s going to yield an odd result like this:

    http://www.youtube.com/embed/http://www.domain.com/xxxxxx

    for the iframe src= attribute which is likely not what you want.

    What may be tripping you up is that retrieving the href from an <a href="index.html"> tag retrieves a fully qualified URL, even if the page source only has a relative URL. If you only want the path or filename from that link href, you will have to parse that off.

    I’ve verified with a reconstruction of your your HTML and your code that if you give this sort of bad URL to the iFrame, it will redirect the whole page (even in Chrome). Here’s the jsfiddle: http://jsfiddle.net/jfriend00/4P3dh/.

    If you hit Run and then click the link that says “Click Me”, it will redirect the whole page because of the bad URL on the iFrame.

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

Sidebar

Related Questions

Here is nice piece of code that works fair in all browsers: http://www.imaputz.com/cssStuff/bigFourVersion.html Since
I have this piece of code that works fine in subsonic 2.2, I migrated
I've got this nifty little piece of code here that self-propogates ad infinitum every
i'm using this piece of code to refresh my div every X seconds: <script>
I have a simple contact form that works in every browser, except IE. It
I have this little piece of jQuery/jqModal code which works fine. However, I am
I'm implementing an API using authentication based on this article: http://www.thebuzzmedia.com/designing-a-secure-rest-api-without-oauth-authentication/ And this related
I am have a piece of code that prompts for user input and works
i want to do this simple piece of code work. #include <iostream> #include <windows.h>
This piece of code used to work in MVC 1 but it does not

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.