Skip to main content

Bug Tracker

Side navigation

#3515 closed bug (invalid)

Opened October 23, 2008 01:24PM UTC

Closed October 27, 2008 05:01PM UTC

ajaxStop not being bubbled to 'body' element

Reported by: tamlyn Owned by:
Priority: minor Milestone: 1.3
Component: ajax Version: 1.2.6
Keywords: Cc: tamlyn, flesler
Blocked by: Blocking:
Description

This code works fine

$('#content').ajaxStart(function(){
	$(this).addClass('loading');
}).ajaxStop(function(){
	$(this).removeClass('loading');
});

but this doesn't:

$('body').ajaxStart(function(){
	$(this).addClass('loading');
}).ajaxStop(function(){
	$(this).removeClass('loading');
});

When attaching the event listeners to the body element it seems ajaxStop is not being triggered because the 'loading' class is not removed.

This, on the other hand, works fine:

$('#content').ajaxStart(function(){
	$('body').addClass('loading');
}).ajaxStop(function(){
	$('body').removeClass('loading');
});
Attachments (0)
Change History (5)

Changed October 24, 2008 09:47PM UTC by flesler comment:1

cc: → tamlyn, flesler

It works for me. Are you doing this inside a document.ready ?

Changed October 24, 2008 09:47PM UTC by flesler comment:2

need: ReviewTest Case

Can you make a test case to reproduce the problem ?

Changed October 24, 2008 10:14PM UTC by flesler comment:3

By the way... bubbling is not related to this at all.

Changed October 27, 2008 04:59PM UTC by tamlyn comment:4

Hmmm, made a test case and it worked - tested the original and that now works too! Sorry about that. Please close as invalid.

Changed October 27, 2008 05:01PM UTC by flesler comment:5

resolution: → invalid
status: newclosed