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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:16:42+00:00 2026-05-23T23:16:42+00:00

So the question is in the title. How can I replace one div content

  • 0

So the question is in the title. How can I replace one div content with another content for some little time using jQuery? I just have one block with user information that invisible (has display: none; in styles and while info is retrieveing from server I want to display message like Loading user info....


EDIT

Here is how I retrieve information from server:

$.post("/getUserAdditionalInfo",
                { "id": pId },
                function (data) {
                    window.user = $.extend(
                    {
                        "pid": pId,
                        "secondname": data.sname,
                        "firstname": data.fname,
                        "middlename": data.mname
                    }, existingParams);
                    updateUserInformationLabels();
                },
                "json"
        );

EDIT2

Here is the code I have for user info:

<div id="UserAdditionalInfo">
<ul class="info">
    <li><b>First name:</b><span id="ExInfoWorkFirstName"></span></li>
    <li><b>Second name:</b><span id="ExInfoWorkSecondName"></span></li>
    <li><b>Middle name:</b><span id="ExInfoWorkMiddleName"></span></li>
</ul>
</div>

And I just want to temporarely replace div with id = UserAdditionalInfo with ‘loading user info’ string. And then data is completely retrieved I need to restore initial content (along replacing place holders with 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-23T23:16:42+00:00Added an answer on May 23, 2026 at 11:16 pm

    store the original html in a variable like this-

    var originalHTMl = $('#UserAdditionalInfo').html();
    

    then replace the content of this div with loading info like this..

    $('#UserAdditionalInfo').html('Loading user info...').show();
    
    $.post("/getUserAdditionalInfo",
                    { "id": pId },
                    function (data) {
                        window.user = $.extend(
                        {
                            "pid": pId,
                            "secondname": data.sname,
                            "firstname": data.fname,
                            "middlename": data.mname
                        }, existingParams);
                        updateUserInformationLabels(originalHTMl);//pass the original html to this function
                        var updatedHTML = $('#UserAdditionalInfo').html();// get the updated HTMl
                        $('#UserAdditionalInfo').html(updatedHTML).show();//Show the div..now this div has all updated htnl
                    },
                    "json"
            );
    
    
    function updateUserInformationLabels(originalHTMl){
                    if (typeof window.patient != 'undefined') {
                    var ExInfoWork = $(originalHTMl).find('#ExInfoWork');
                     ExInfoWork.html(window.patient.work);
                    }
             // more replacement logic as you said
    } 
    // don't return anything
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well, question is in title. Is it possible at all? I can use css
the title already tells the question: you can successfully call the Print-Method on a
Title is the entire question. Can someone give me a reason why this happens?
Not sure if the title is quite right for the question but I can't
I guess the question title sums it up. Is there a time when it
As the question in the title states. I can't seem to find the answer
Javascript and jQuery (Fancybox) question I'm using the Javascript function below for Twitter sharing
Update: The question title can be misleading. This was not Go's fault at all.
Question title is basically the entire question. In ASP.NET you can set the Culture/UICulture
Question title might be meaningless, but I tried. :) Here's my situation: I have

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.