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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:37:09+00:00 2026-06-17T22:37:09+00:00

I am wanting to implement AJAX into the admin pages of my WordPress theme.

  • 0

I am wanting to implement AJAX into the admin pages of my WordPress theme. I seem to almost be there, but I am somehow fading-in the wrong class.

Please see this screenshot with the class labels provided:

Theme Options Screenshot

Here is what’s happening:

  1. I click on Appearance > Site Options and the page display correctly with a single page of options

  2. I click on one of the top navigation tabs, and the page fades out correctly.

  3. When the page fades back in – it appears like the 2nd screenshot below.

enter image description here

Here is the code that is currently handling the request:

 jQuery('.nav-tab').live('click', function(e){ 
     e.preventDefault();
     var link = jQuery(this).attr('href'); //Get the href attribute
 jQuery('.page-form').fadeOut(500, function(){ //fade out the content area
 jQuery("#loader").show(); // show the loader animation
    }).load(link + '.page-form', function(){ jQuery('.page-form').fadeIn(500, function(){ 
 jQuery("#loader").hide(); //hide the loader
   });
  });
 });

So I just need to know how to show only the “page form” class inside of the rendered content, not the entire wordpress admin area.

  • 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-17T22:37:11+00:00Added an answer on June 17, 2026 at 10:37 pm

    You’re loading the entire page in your AJAX request (as mentioned by Bence) and modifying the response server-side is the best option, however, it is possible to fix this using jQuery;

    jQuery('.nav-tab').on('click', function(e){ 
        e.preventDefault();
        jQuery('.page-form').load(jQuery(this).attr('href') + ' .page-form');
    });
    

    This should load the url from the location of the clicked link and extract the element with class ‘.page-form’ from the result and replace the element selected by ‘.page-form’ with its content. However;

    • make sure that a [space] is present between the url and the selector (‘ .page-form’), a space is missing in your code
    • using a ‘class’ as selector may return multiple elements, I’m not sure what the result will be in case multiple elements are selected

    See the documentation here:
    http://api.jquery.com/load/

    NOTE:
    You’re using jQuery.live() in your code, which is deprecated since jQuery 1.7 (http://api.jquery.com/live/). You may want to rewrite your code and use jQuery.on() as its replacement (http://api.jquery.com/on/)

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

Sidebar

Related Questions

There are some events expose via WMI, but I can't seem to find any
Wanting to integrate aspects of SharePoint into an existing website - rather than integrating
I'm wanting to extract a zip file loaded with images into memory in some
I am trying to implement long polling in my Spring-MVC Web App but it
I have this ajax call executing from client side, with jQuery, but at times,
I'm wanting to implement a custom text interface, with touch+drag selecting text and the
i own a translation service and now im wanting to implement a TTS solution.
I found myself wanting to implement an IAwaitable class (something that implements asynchronous calls
I'm not sure what I'm wanting to do is even a good idea, but
Doing some work on a Drawing Canvas and I'm wanting to implement a Redo

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.