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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:36:26+00:00 2026-06-10T03:36:26+00:00

So this is really a two-part question: why isn’t it working, and should I

  • 0

So this is really a two-part question: why isn’t it working, and should I even bother?

I have an ajax application that uses a lot of jquery’s .load() and .get(). In my global js file I’ve added these lines to test jQuery’s global ajaxComlete function:

$('body').ajaxComplete(function(e){
    alert();
});

I’m not getting any alerts when the ajax runs throughout the application. Does anyone know why?

The reason I want this is because I have a lot of styles that are applied through class names, and every ajax load essentially clears the old classes and brings in new classes. This removes my styling. So I have a global function called styleForm() that reapplys all my styles. I call this function in every individual ajax callback. ie:

$.get('source.cfm',funcion(){
    styleForm();
});

I know having this global ajax function will produce what most would probably consider ‘clearner’ code. But would it impact the performance much? If so, I don’t want to do that. If not, then I’d like to get this working.

  • 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-10T03:36:28+00:00Added an answer on June 10, 2026 at 3:36 am

    Have you tried binding the ajaxComplete to $(document)?

    In our code we use $.ajaxSetup({}), $(document).ajaxStart(function(){}) and $(document).ajaxStop(function(){}).

    The reason you need to use $(document):

    $.get is basically shorthand for $.ajax which will will trigger the ajax events (.ajaxComplete, .ajaxError, etc.) on document.

    $('body').ajaxComplete will only trigger if you have bound an ajax event to it or a lower dom element. Usually this means something like $('<header>').load('http://www.example.com');

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is really a two part question . I'm struggling with two problems that
This is really a two part question: I'm seeing some users in the Grantee
I'm really new to JavaScript and jQuery. My question is this. I have two
This is really a two part question, since I don't fully understand how these
This is really a two part question. First, is it possible to detect if
This is a two part question, really. Preface: I use WinRAR to compress files.
I have a question that really feels like I should have an easy answer
This is really a two part question, but they're kinda related: How does Windows
This is really two questions: Why isn't the membership operator (__contains__) ever being called?
I am having a really hard time getting this to work. I have two

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.