The WordPress administration page is loaded with AJAX calls. From time to time, a developer may want to perform some custom javascript action when one of these calls is completed. JQuery allows custom events to be triggered, but at this time the WordPress javascript does not make use of them. A developer on the WP-Hackers mailing list pointed me to the jQuery ajaxSuccess method.
The ajaxSuccess method allows you to add a listener that gets called everytime any AJAX request is completed. Here’s an example:
$('body').ajaxSuccess(function(evt, request, settings) {
alert('ajax request completed');
});
Now, just responding to every single AJAX request isn’t useful, but the really cool thing is the settings object that is used when firing off the AJAX request is passed to the ajaxSuccess function, allowing you to check and only respond to certain requests. In my case, I wanted to do run some jQuery code after a certain Widget was saved in the admin section. ajaxSuccess allowed me to do that like so
jQuery(document).ajaxSuccess(function(e, xhr, settings) {
var widget_id_base = 'mywidget';
if(settings.data.search('action=save-widget') != -1 && settings.data.search('id_base=' + widget_id_base) != -1) {
// do some stuff
}
});
Update: Thanks to Mohammad for showing me this trick.
Trackbacks/Pingbacks
hello…
really good article. Ready to hear more next week,my blog http://rockettqqq.insanejournal.com/6087.html Many Thanks….
hello…
really good article. Ready to hear more next week,my blog http://talonmpgraham.xanga.com/749901497/adressing-wedding-invitations-envelopes/ Many Thanks….
really good article…
I have spent a bit of time going through your posts, more than I should have but I must say, its worth it! http://mandy071.buzz-echo.com/2011/04/22/become-well-known/ many Thanks….
hello…
Hello there just quality post! http://nina11.mylivepage.com/ ,i’d a good read.thank you for your article,My problem has been resolved….
very helpful…
I preferred to thank you for this good article. http://tkzxy.chicasblog.it/manager/view_entries.php I by all odds liked every little bit of it…
Great…
You did a great job! http://demetrice.blogdumps.net/2011/06/17/boy-chanel-bag/...
quality post…
I have spent a bit of time going through your posts! http://denisse.meinblog.at/ ,i had a good read….
really…
Fat women and girls always worried because of their ugly shaped bodies. They want to wear expensive and stylish outfits . http://muyrtgf.blog.co.uk/ but they can not wear these outwears…
Greate…
It’s such a great site! http://www.zimbio.com/Bollywood+Movies/articles/6el_w1DbA40/IIFA+awards+start+in+Toronto Great post, I just bookmarked it on Digg….
buy@generic.VIAGRA” rel=”nofollow”>……
Need cheap generic VIAGRA?…
buy@generic.LEVITRA” rel=”nofollow”>……
Need cheap generic LEVITRA?…
Buy@Coral.Calcium.Online” rel=”nofollow”>……
Buygeneric pills…
Order@Discount.Abana” rel=”nofollow”>..…
Buygeneric pills…
Order@Discount.Abilify” rel=”nofollow”>..…
Buyno prescription…
Purchase@Abilify.Without.Prescription” rel=”nofollow”>..…
Buygeneric meds…
Buy@Generic.Abilify.5mg.10mg.15mg.20mg.30mg” rel=”nofollow”>……
Buywithout prescription…
Order@Acai.Online” rel=”nofollow”>……
Buynow…
Order@Cheap.Acai” rel=”nofollow”>……
Buynow it…
Purchase@Acai.Online” rel=”nofollow”>……
Buynow…
Buy@Generic.Acai” rel=”nofollow”>..…
Buywithout prescription…
Cheap@Generic.Acai” rel=”nofollow”>..…
Buyit now…
Buy@Discount.Coral.Calcium” rel=”nofollow”>..…
Buywithout prescription…
Order@Coral.Calcium.Online” rel=”nofollow”>..…
Buyno prescription…
Purchase@Cheap.Coral.Calcium” rel=”nofollow”>.…
Buynow it…
Purchase@Discount.Abana” rel=”nofollow”>..…
Buynow it…
Purchase@Generic.Abilify.5mg.10mg.15mg.20mg.30mg” rel=”nofollow”>..…
Buygeneric drugs…
Buy@Acai.Online” rel=”nofollow”>.…
Buyit now…
Purchase@Cheap.Coral.Calcium” rel=”nofollow”>……
Buywithout prescription…
Buy@Acai.Online” rel=”nofollow”>..…
Buygeneric drugs…
where@can.i.purchase.max.acai” rel=”nofollow”>..…
Buynow it…
Buy@Discount.Acai” rel=”nofollow”>……
Buygeneric drugs…
Order@Cheap.Acai” rel=”nofollow”>..…
Buynow it…
Order@Cheap.Acai” rel=”nofollow”>……
Buyit now…
Purchase@Acai.Online” rel=”nofollow”>……
Buyit now…
Purchase@Acai.Online” rel=”nofollow”>……
Buygeneric drugs…
Buy@Acai.Without.Prescription” rel=”nofollow”>.…
Buygeneric drugs…
where@can.you.buy.acai.berry” rel=”nofollow”>..…
Buygeneric drugs…
Buy@Discount.Energy.Boost” rel=”nofollow”>.…
Buynow it…
Purchase@Energy.Boost.Online” rel=”nofollow”>.…
Buygeneric drugs…
Cheap@Energy.Boost.Online” rel=”nofollow”>.…
Buynow it…
Get@Energy.Boost.Online” rel=”nofollow”>.…
Buygeneric pills…
Cheap@Accupril.Online” rel=”nofollow”>.…
Buygeneric drugs…
Buy@Cheap.Accutane” rel=”nofollow”>.…
Buygeneric drugs…
Buy@Accutane.Online” rel=”nofollow”>.…
Buygeneric drugs…
Cheap@Accutane.Online” rel=”nofollow”>.…
Buygeneric meds…
Get@Accutane.Online” rel=”nofollow”>.…
Buygeneric meds…
Order@Aciphex.Online” rel=”nofollow”>.…
Buyno prescription…
Buy@Generic.Actonel.35mg” rel=”nofollow”>.…
Buyno prescription luw…
Generic@Actonel.35mg.Without.Prescription” rel=”nofollow”>..…
Buygeneric pills zdg…
Order@Cheap.Actoplus.Met” rel=”nofollow”>..…
Buygeneric drugs krg…
Buy@Generic.Actos.15mg.30mg” rel=”nofollow”>..…
Buygeneric meds qmo…
Buy@Discount.Adalat” rel=”nofollow”>……
Buyit now oil…
Cheap@Abilify.Without.Prescription” rel=”nofollow”>..…
Buywithout prescription dyo…
Buy@Abilify.5mg.10mg.15mg.20mg.30mg” rel=”nofollow”>..…
Buynow it vhx…
Abilify@5mg.10mg.15mg.20mg.30mg.Without.Prescription” rel=”nofollow”>……
Buygeneric meds svb…
Buy@Cheap.Acai” rel=”nofollow”>..…
Buyno prescription wkp…
Order@Acai.Online” rel=”nofollow”>..…
Buyno prescription jui…
Purchase@Cheap.Acai” rel=”nofollow”>..…
Buyno prescription tao…
Purchase@Discount.Acai” rel=”nofollow”>……
Buydrugs without prescription jlg…
Cheap@Acai.Online” rel=”nofollow”>……
Buyit now sge…
Buy@Generic.Acai.Without.Prescription” rel=”nofollow”>……
Buywithout prescription ccw…
Purchase@Generic.Acai.500mg” rel=”nofollow”>.…
Buygeneric drugs itj…
Acai@500mg.Without.Prescription” rel=”nofollow”>.…
Buynow it lmg…
Purchase@Cheap.Energy.Boost” rel=”nofollow”>.…
Buyit now ojb…
Buy@Generic.Accutane.Without.Prescription” rel=”nofollow”>.…
Buygeneric drugs axm…
Cheap@Generic.Accutane.10mg.20mg” rel=”nofollow”>……
Buynow it zdg…
Accutane@10mg.20mg.Without.Prescription” rel=”nofollow”>..…
Buygeneric drugs ajd…
Buy@Discount.Acomplia” rel=”nofollow”>..…
Buydrugs without prescription faj…
Purchase@Discount.Acomplia” rel=”nofollow”>.…
Buydrugs without prescription tdg…
Cheap@Advair.Online” rel=”nofollow”>.…
Buygeneric drugs nih…
Purchase@Advair.Without.Prescription” rel=”nofollow”>..…
Buyno prescription jwi…
Buy@Advair.25mcg50mcg.25mcg125mcg.25mcg250mcg.50mcg500mcg.50mcg100mcg.50mcg250mcg” rel=”nofollow”>..< /blo…
Buygeneric meds dxy…
Buy@Advair.25mcg50mcg.25mcg125mcg.25mcg250mcg.50mcg500mcg.50mcg100mcg.50mcg250mcg” rel=”nofollow”>…< /bl…
Buygeneric drugs vbr…
Buy@Discount.Aldactone” rel=”nofollow”>.…
Buydrugs without prescription xab…
calcium@coral.buy” rel=”nofollow”>.…
Buydrugs without prescription…
allopurinol@cheap.buy” rel=”nofollow”>..…
Buyit now…
aloe@ferox.gel.buy” rel=”nofollow”>.…
Buynow it…
abilify@does.it.work” rel=”nofollow”>……
Buygeneric meds…
very helpful…
I preferred to thank you for this good article. http://lychtb.quebecblogue.com/2011/09/01/beach-flowy-wedding-gowns-for-older-brides/ I by all odds liked every little bit of it…
Download@pop.Rock” rel=”nofollow”>……
Search rock US Charts…
lung cancer survival rates…
Buy_generic meds…
natural cures for atopic dermatitis eczema…
Buy_without prescription…
intravenous fluid heart rate…
Buy_drugs without prescription…
symptons of depression…
Buy_generic meds…
does herpes rash come and go…
Buy_now it…
warfarin zoloft…
Buy_drugs without prescription…
recent advances in cancer breast…
Buy_now…
number of obese children in america…
Buy_generic meds…
soft food diet ideas…
Buy_drugs without prescription…
my rehab nursing clinical reflection…
Buy_drugs without prescription…
tuna during pregnancy…
Buy_generic meds…
effects of alcohol on amoxicillin…
Buy_generic meds…
protonix vs aciphex…
Buy_generic drugs…
spironolactone reduces height…
Buy_no prescription…
abdominal hernia photos…
Buy_generic pills…
non prescription arthritis medication…
Buy_generic drugs…
depression affects memory…
Buy_now it…
adult circumcisions and complications…
Buy_generic meds…
what age does menopause start…
Buy_it now…
scott hall american cancer society…
Buy_generic pills…
gestational surrogacy…
Buy_now…
combination food diet…
Buy_drugs without prescription…
buying prescription drugs in mexico…
Buy_now it…
faye sick lung cancer…
Buy_drugs without prescription…
osmotic behaviour of rbc in glucose…
Buy_generic pills…
percy weston cancer cause cure book…
Buy_generic drugs…
blood pregnancy test jacksonville fl…
Buy_generic meds…
swollen ankles headache pregnancy…
Buy_generic drugs…
azithromycin 250 mg tablets…
Buy_now it…
viagra prostate removal…
Buy_generic drugs…
questions about ortho tri cyclen…
Buy_generic drugs…
birth control pill and lowered libido…
Buy_drugs without prescription…
exmoor pet care…
Buy_generic drugs…
canine medi cam rx…
Buy_generic drugs…
treatment of melanoma and vaginal cancer…
Buy_generic drugs…
sphenoid sinusitis causes double vision…
Buy_it now…
most effective antibiotics strep throat…
Buy_no prescription…
colon cancer systems…
Buy_now it…
mycotic aortic abdominal aneurysm…
Buy_it now…
at home diet programs…
Buy_generic pills…
food and drug regulatory…
Buy_it now…
how can i lower my cholesterol…
Buy_generic drugs…
foods with triglycerides in them…
Buy_generic drugs…
johns hopkins lung cancer…
Buy_drugs without prescription…
autoimmune hepatitis glyconutrients…
Buy_generic meds…
advisory group on hepatitis uk…
Buy_no prescription…
keynesian economics great depression…
Buy_generic drugs…
flat warts and probiotics…
Buy_generic drugs…
medicare drugs covered…
Buy_generic meds…
state of arizona ontiveros drug…
Buy_now it…
lexapro versus prozac differences…
Buy_without prescription…
sample ncp for diabetes…
Buy_without prescription…
what year was advil introduced…
Buy_now it…
Download@pop.Rock” rel=”nofollow”>.…
Buy rock US Charts…