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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:56:34+00:00 2026-05-27T11:56:34+00:00

Possible duplicate: jquery change div text The above question is a possible duplicate, but

  • 0

Possible duplicate: jquery change div text

The above question is a possible duplicate, but I don’t know why it doesn’t work. I’m fairly new to jQuery as well.

Below is part of the function (all I have written right now). It’s being triggered with an onclick event for an anchor tag.

function changeStatus(user)
{
    var esc = true;
    $.get('ajax/popupBase.html', user, function(data, stat, d) {
        $("#AjaxFrame").html(data);
    }, 'html');

    $.get('ajax/changeStatus.html', user, function(data, stat, d) {
        $("#PopupBody").html(data);
    }, 'html');

    $("#AjaxFrame").fadeIn('fast');
    $("#PopupTitle").html("Status Update");
    $("#Popup").center();
    popupState = 1;

    return esc;
}

Here is the template “popupBase.html” that I’m using with $.get():

Note: “popupBase.html” is a reproducible “popup” window that I have on this site and I can just insert data into the empty divs, and re-use html where possible

<div id="Popup">
    <form id="Popup1" method="post">
        <div id="PopupTitle"></div>

        <div id="PopupBody"></div>

        <input class="button" id="Save" name="saveChanges" type="submit" value="OK" />
        <input class="button" id="Cancel" name="clearChanges" type="button" value="Cancel" />
    </form>
</div>

The #AjaxFrame is a container just outside all html on my site (inside <body>, outside #Wrapper). I also have two empty containers on my template from my $.get() call, called #PopupTitle and #PopupBody.

Question: Inserting the html retrieved from “changeStatus.html” into #PopupBody works fine, however, adding static text from #PopupTitle doesn’t work. In this possible duplicate‘s answer, I tried using .text() to no avail.

EDIT: A note for future readers, I am clearing the contents of the #AjaxFrame after each use which should renew the ID usage.

Other things I’ve tried: clearing Chrome’s cache (both latest and portableapp version) and checking for typos over and over.

I’m realllly confused about this, any help is appreciated.

  • 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-27T11:56:35+00:00Added an answer on May 27, 2026 at 11:56 am

    Your running into a race condition, javascript isn’t going to wait for those $.get functions to complete before running what happens after it.

    If you want “Status Update” to be in PopupTitle AFTER your ajax gets have run their course, it has to go in the success handler

    function changeStatus(user)
    {
        var esc = true;
        $.get('ajax/popupBase.html', user, function(data, stat, d) {
            $("#AjaxFrame").html(data);
        }, 'html');
    
        $.get('ajax/changeStatus.html', user, function(data, stat, d) {
            $("#PopupBody").html(data);
            $("#PopupTitle").html("Status Update");   //will over write what is in data
        }, 'html');
    
        $("#AjaxFrame").fadeIn('fast');
    
        $("#Popup").center();
        popupState = 1;
    
        return esc;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: jQuery bind click ANYTHING but ELEMENT I have this HTML <div id=outer>
Possible Duplicate: jQuery : simulating a click on a <input type=“file” /> doesn't work
Possible Duplicate: jQuery change input type How to replace input[type=submit] to input[type=text] using jQuery?
Possible Duplicate: Why don't self-closing script tags work? I'm trying jquery now. When I
Possible Duplicate: jquery trigger - ‘change’ function I have a radio button set called
Possible Duplicate: jQuery: text() vs html()? What's the difference between text and html() in
Possible Duplicate: jquery/ajax load new content when available i have a table named news
Possible Duplicate: How to change the href for a hyperlink using jQuery I have
Possible Duplicate: jQuery question: what does it really mean? For example, (function (exports, $,
Possible Duplicate: Can someone Explain this jQuery code? I have posted this before, but

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.