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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:06:10+00:00 2026-06-10T06:06:10+00:00

Below is the code snippet which is hitting the url on server and getting

  • 0

Below is the code snippet which is hitting the url on server and getting the html response.I can see
the response inside firefox debugger but it does not display in div tag.

$.ajax({
    url: url,
    dataType: 'html',
    data: '',
    type: 'POST',
    success: function(data) {
        //in firefox debugger i can see complete html response inside data 
        $('#displayContent').html(data); // but here, it does not  
        // append the html inside div displayContent. Instead it makes 
        // the current page blank
    }
});​

I don’t get what mistake I’m making here Can I not directly assign the ajax html response to an selector(div tag in my case) with $('#displayContent').html(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-06-10T06:06:11+00:00Added an answer on June 10, 2026 at 6:06 am

    Instead of using html() method use append i.e.

    $('#displayContent').append(data);
    

    Or if you want to assign whole content direct to your element use load method

    $(function(){
       $('#displayContent').load(url);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Which code snippet will give better performance? The below code segments were written in
I have below snippet of code in which TestClass is extending jPanel which is
Below is a code snippet from a book. Why can serialNumber still be set
i ran across something similar to the below code snippet, which throws a compiler
I have the code snippet below in C++ which basically calculates the pi using
Below is the code snippet which I use to get a list of all
Consider the below code snippet: for(i=0;i<10;i+=2) // 1 for(i=0;i<2;i=i+2) // 2 Which one will
Below is the code snippet with comments which describes the problem statement. We have
I have a sample code snippet below which works just fine (I trimmed the
I have found a code snippet as given below which is used to disable

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.