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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:54:16+00:00 2026-05-30T12:54:16+00:00

I have a jsFiddle here : http://jsfiddle.net/ZXDYS/22/ I am creating Blogger post summaries using

  • 0

I have a jsFiddle here : http://jsfiddle.net/ZXDYS/22/

I am creating Blogger post summaries using jQuery although it will not return the element iframe’s attr src…You can find the blog here for reference . what have i done wrong? please help!

$.ajax({
    url: 'http://www.blogger.com/feeds/1570527947646221682/posts/default?alt=json-in-script&max-results=3',
    type: 'get',
    dataType: "jsonp",
    success: function(data){
        for (var i = 0; i < data.feed.entry.length; i++){
            var title = data.feed.entry[i].title.$t;
            var content = data.feed.entry[i].content.$t;
            var img = $(content).find("img").attr("src");
            var iframe = $(content).find("iframe").attr("src");
            if(img==undefined){
                var imgsrc = "no image in post :( sorry?";
                    }else{
                    var imgsrc = img;
            }
            $('div.related').append('<table border="1"><tr><td colspan="2">post title - '+title+'</td></tr><tr><th width="100%">Image src</th><th width="100px">Iframe src</th></tr><tr><td>'+imgsrc+'</td><td>'+iframe+'</td></tr></table>');           
        }
    }
});​
  • 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-30T12:54:18+00:00Added an answer on May 30, 2026 at 12:54 pm

    The returned string from your JSONP request looks like:

    <iframe width="100%" height="315" src="http://www.youtube.com/embed/9u7Fp2VVdkM"
     frameborder="0" allowfullscreen></iframe>video
    <div class="blogger-post-footer">
       <img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1570527947646221682-8424983193135836585?l=ykhaliq.blogspot.com' alt='' />
    </div>
    

    Notice that the <iframe> element does not have a parent element. The .find method finds any descendants, but not the “root” elements.

    A general solution is to create a wrapper, and append the string:

    var $content = $('<div>').html(content);
    var img = $content.find("img").attr("src");
    var iframe = $content.find("iframe").attr("src");
    

    Fixed code: http://jsfiddle.net/ZXDYS/31/

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

Sidebar

Related Questions

i have this script found here http://jsfiddle.net/g4txt/ i am using this carousel http://www.thomaslanciaux.pro/jquery/jquery_carousel.htm the
Ok, if you go here: http://jsfiddle.net/RarFB/2/ You will see the work that I have
HI I have this jquery menu here http://jsfiddle.net/pJMva/8/ and it doesnt seem to work
I have this type of exercise in jquery. Go here http://jsfiddle.net/LAntL/3/ For Item 1
Demoed here: http://jsfiddle.net/dRtaR/2/ The label option of the Jquery UI button does not work.
JSfiddle (showing the non-working code) here: http://jsfiddle.net/ts2Rr/ I have three boxes that a user
All of this is code is here: http://jsfiddle.net/yrgK8/ I have a news section which
I have a simple script that closes a DIV. An example is here: http://jsfiddle.net/22fTm/3/
See here: http://jsfiddle.net/QVhAZ/4/ How can I use * but only have it apply to
I have created fiddle here: http://jsfiddle.net/ozzy/WEGMh/ How it should look is here: Issue is

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.