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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:46:51+00:00 2026-05-28T02:46:51+00:00

In my website I have a file called learn-more.html , it’s used to load

  • 0

In my website I have a file called learn-more.html , it’s used to load stuff from index.html using AJAX.

learn-more.html

<div id="something" class="hero-unit span-one-third" style="position: relative;">
    Foo Bar
</div>

<div id="main-images" class="hero-unit span-one-third" style="position: relative;">
    <div id="learn-more-photo" class="span-one-third">
        <img class="thumbnail" src="http://placehold.it/300x180" alt="">
    </div>
</div>

I have the following script located in index.html

<script type="text/javascript" charset="utf-8">
        $(document).ready(function() {
            $("#learn-more-button").click(function() {
                $.get('ajax/learn-more.html #main-images', function (data) {
                        alert(data);
                });
</script>

Problem:
The alert prints the contents of: learn-more.html

<div id="something" class="hero-unit span-one-third" style="position: relative;">
Foo Bar
</div>

<div id="main-images" class="hero-unit span-one-third" style="position: relative;">
    <div id="learn-more-photo" class="span-one-third">
        <img class="thumbnail" src="http://placehold.it/300x180" alt="">
    </div>
</div>

Expected
The alert should print the content of: <div id="main-images">

<div id="learn-more-photo" class="span-one-third">
    <img class="thumbnail" src="http://placehold.it/300x180" alt="">
</div>

What could be going on here ?

EDIT: I’m willing to upload a .zip with the real files… it’s just index.html plust learn-more.html and the css, if anyone is interested let me know.

EDIT2: This prints out the whole learn-more.html content

$.get('ajax/learn-more.html #main-images', function (data) {            
    alert(data);
});
  • 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-28T02:46:51+00:00Added an answer on May 28, 2026 at 2:46 am

    I solved my issue,

    $(data) returns an array of elements and not a jQuery object. $(data)[x] contains the element I was looking for.

    To retrieve it, I ended up using

    $(data).filter('#main-images');
    

    Thanks everyone for your help!

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

Sidebar

Related Questions

I have an xml file called index.xml this is in my website here: www.mywebsite.com/siteregistry/index.xml
Say I have a file in my kohana 3 website called assets/somefile.jpg . I
I have a website that generates pdf file from CSP. Will this pdf file
I have copied zipped file from the playframework.org website and unzipped it at a
I am downloading a file from a website and I have the link. But
I have a function called init on my website in an external file called
I am making a project file called Business . I have a website project
We have a website that uses #include file command to roll info into some
I have a website which allows secure (ssl) file uploads and download. The site
I have a .htaccess file in the root of a website: /var/www/mywebsite/htdocs/.htacess and I

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.