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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:44:14+00:00 2026-06-14T23:44:14+00:00

I am unable to get the data from my ajax request to appear inside

  • 0

I am unable to get the data from my ajax request to appear inside <div class="l_p_i_c_w"></div>. What am I doing wrong? I know the function inside my_file.php works, because if I refresh the page, then the data shows up where it should.

jQuery:

$.ajax({
        type: "POST",
        url: "my_file.php",
        dataType: 'html',
        success: function(data){
            $('div#myID div.l_p_c div.l_p_i_c_w').prepend(data);
        }
});

HTML:

<div class="l_p_w" id="myID">
    <div class="l_p_c">
        <div class="l_p_i_c_w">
       <!-- stuff, or may be empty. This is where I want my ajax data placed. -->
        </div>
    </div>
</div>

CSS:

.l_p_w {
    width:740px;
    min-height:250px;
    margin:0 auto;
    position:relative;
    margin-bottom:10px;
}

.l_p_c {
    position:absolute;
    bottom:10px;
    right:10px;
    width:370px;
    top:60px;
}

.l_p_i_c_w {
    position:absolute;
    left:5px;
    top:5px;
    bottom:5px;
    right:5px;
    overflow-x:hidden;
    overflow-y:auto;
}
  • 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-14T23:44:15+00:00Added an answer on June 14, 2026 at 11:44 pm

    I think if you use prepend you would need to wrap your data object in jquery tags like $(data) before appending, as prepend appends children (objects)

    $.ajax({
                type: "POST",
                url: "my_file.php",
                dataType: 'html',
                success: function(data){
                    $('div#myID div.l_p_c div.l_p_i_c_w').prepend($(data));
                }
        });
    

    However, if you just want to set the html of the div with the data do this:

    $.ajax({
            type: "POST",
            url: "my_file.php",
            dataType: 'html',
            success: function(data){
                $('div#myID div.l_p_c div.l_p_i_c_w').html(data);
            }
    });
    

    Third Option, try prependTo

    http://api.jquery.com/prependTo/

    $.ajax({
        type: "POST",
        url: "my_file.php",
        dataType: 'html',
        success: function(data){
            $(data).prependTo($('div#myID div.l_p_c div.l_p_i_c_w'));
        }
    });
    

    One last attempt:

    $.ajax({
                type: "POST",
                url: "my_file.php",
                dataType: 'html',
                success: function(data){
                    $('div#myID div.l_p_c div.l_p_i_c_w').html(data + $('div#myID div.l_p_c div.l_p_i_c_w').html());
                }
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

jQuery.ajax( { url:'http://en.wikipedia.org/wiki/Football', type:'get', dataType:'jsonp', success:function(data){alert(data);}, } i want to read wikipedia page from
$.ajax({ type: 'GET', url: string.txt, cache: false, success: function(str){ alert(Data is: + str); }
this is my script , i am unable to get the json data from
When I try to EDIT a tennis court... I get this exception :System.Data.UpdateException; Unable
I renamed the class classBattle to Game and not I get Unable to load
I want to get data from an HTML web page, then display it in
It seems that I am unable to change most request headers from JavaScript when
I am unable to understand that why the jquery AJAX is not fetching data
I am trying to display JSON data that I retrieve from an ajax call
Due to Ajax loaded content, I had to change a function from: document.observe('dom:loaded',function() {

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.