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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:31:09+00:00 2026-06-08T18:31:09+00:00

I’m new to jQuery and having some trouble. A have a page that has

  • 0

I’m new to jQuery and having some trouble. A have a page that has a iframe inserted after the page loads. I need to find the anchor links in the content of the iframe and compare their href to a URL. Just trying the pure JavaScript getElementById() doesn’t work because the iframe is inserted after the load. I read that I should be using either jQuery’s live(), delegate(), or on(), but I’m not sure how they work. Also, if there is a pure Javascript solution that would be awesome as well.

The iframe I need to parse is:

<iframe src="http://assets.tumblr.com/iframe.html?10&src=http%3A%2F%2Fstaff.tumblr.com%2F&amp;lang=en_US&amp;name=staff"
    scrolling="no" width="330" height="25" frameborder="0" 
    style="position:absolute; z-index:1337; top:0px; right:0px; 
           border:0px; background-color:transparent; overflow:hidden;" 
           id="tumblr_controls">
</iframe>

It is appended to every Tumblr blog (see Tumblr Staff Blog).

The part of the iframe’s content I’m interested in looks like:

<div style="position:absolute; top:3px; right:3px; white-space:nowrap; height:20px;">
    <form action="/follow" method="post" style="display:block; float:left;" onsubmit="_gaq.push(['_trackEvent', 'Iframe', 'Follow', 'staff');">
    <input type="hidden" name="form_key" value="8W0r1XnbOEtpTF0q8oe96BmGMJg"/>
    <input type="hidden" name="id" value="staff"/>
    <input type="image" src="http://assets.tumblr.com/images/iframe_follow_alpha.png 1018" style="width:58px; height:20px; border-width:0px; display:block; margin-left:3px; cursor:pointer;" alt="Follow"/>
    </form>
    <a target="_top" href="http://www.tumblr.com/dashboard">
    <img src="http://assets.tumblr.com/images/iframe_dashboard_alpha.png?1018" alt="Dashboard" style="height:20px; width:81px; border-width:0px; display:block; float:left; cursor:pointer;"/>
</a>

I need to compare all the possible anchor links in this content and compare their hrefs to a URL.

  • 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-08T18:31:10+00:00Added an answer on June 8, 2026 at 6:31 pm
    function getHref() {
    
      var src = false,
          iframe = $('iframe#tumblr_controls');  // keep reference of iframe;
      // check that iframe loaded
      if( iframe.length) { 
         src = iframe.find('a[target=_top]').attr('href');
      }
    }
    

    Now you can call getHref() to get the href of link within iframe and use that for comparison.

    You can also try like following:

    $('iframe#tumblr_controls').load(function() {
       var href = $(this).find('a[target=_top]').attr('href');
    });
    

    If you have multiple a tags within your content then try:

    function compareHrefs() {
      var iframe = $('iframe#tumblr_controls');  // keep reference of iframe;
      // check that iframe loaded
      if( iframe.length) { 
         // looping over each  tag
         iframe.find('a').each(function() {
              if ( this.href == TARGET_URL ) {
                 // do something
              }
         });
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a jquery bug and I've been looking for hours now, I can't
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
In my XML file chapters tag has more chapter tag.i need to display chapters

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.