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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:04:00+00:00 2026-06-18T15:04:00+00:00

How do I trigger a function when an AJAX response is complete? On change

  • 0

How do I trigger a function when an AJAX response is complete?

On change of the drop down the manageImagesDynamicObjectDetails function is called:

<select id="imageComponentSelection" name="imageComponentSelection" onchange="manageImagesDynamicObjectDetails()">

This function passes variables related to this AJAX call to my makeRequests function.

function manageImagesDynamicObjectDetails(){
  var sendContent = "selection=".concat(document.getElementById('imageComponentSelection').value);
  var fileName = "RetrieveObjectsInformation";
  var elementId = "objectData";
  if(sendContent != "Select a class to view components"){
  makeRequest(fileName,sendContent,elementId);
  } 
}

makeRequest is a function which will be called for all AJAX calls and deals with them appropriately.

function makeRequest(fileName,sendContent,elementId) {
 var xmlHttpRequest = getXMLHttpRequest();
 xmlHttpRequest.onreadystatechange = getReadyStateHandler(xmlHttpRequest,elementId);
 xmlHttpRequest.open("POST", fileName, true);
 xmlHttpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
 xmlHttpRequest.send(sendContent);
}

When the speicif AJAX call is complete I want to call the resizeObjectList function.

function resizeObjectList(){
  var windowHeight = $('#contentWrapper').height();
  var newObjectListHeight = windowHeight - 53 - 20 - 20 - 60;
  var element =  document.getElementById("componentObjectList");
  if (typeof(element) != 'undefined' && element != null){
    document.getElementById("componentObjectList").style.height = newObjectListHeight;
  }
}

How do I do this? I’ve tried ajaxComplete and ajaxStop but I could not get them to trigger.

  • 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-18T15:04:01+00:00Added an answer on June 18, 2026 at 3:04 pm

    I beleive you want somthing like:
    response = xmlHttpRequest.responseText;

    bute the above works if you make ajax async. read: http://www.w3schools.com/ajax/ajax_xmlhttprequest_send.asp

    if you use jquery, it makes ajax a lot more simple: http://api.jquery.com/jQuery.ajax/

    here is an example:

    $.ajax({
      url: "http://fiddle.jshell.net/favicon.png",
      type: "GET"
      data: "key0=val0&key1-val1"
    }).done(function( data ) {
      alert(data)
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my ajax success handler success: function(data) { $('#contact'+finalForm[0].value).hide(drop, {direction: 'up'}, 1000, function(){
I have this Javascript: <script language=javascript type=text/javascript> $().ready(function() { $('#ex2').jqm({ajax: 'view.php?id=<?=$objResult[id];?>', trigger: 'a.ex2trigger'}); });
I'm very new to trigger function. Actually this is the first time I'm using
When I pass 'this' to an anonymous function like so: MyClass.prototype.trigger = function(){ window.setTimeout(function(){this.onTimeout();},1000);
In a PHP page I have a drop-down list that triggers the jQuery change
I need to trigger function bar() whenever function foo() fires. I have no control
I am using a trigger function to write data into a new table in
I am basically trying to trigger a function if the footer is inside the
I am trying to get the Enter key to trigger a function when it
I have issues with Firefox and keydown function. It will not trigger the 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.