Support » Plugin: Advanced AJAX Page Loader » Retrieve Body Class from DATAA

  • Resolved zumajoe


    Trying to grab the class names from the loaded content’s Body Class (so that I can replace the body class on the current page with what was loaded), I’ve come up with the following but cannot seem to get this to work:

    classes =  jQuery(dataa).find('body').attr ("class").split(' ');
    for(var i=0; i<classes.length; i++){

    Anyone have a clue?

Viewing 6 replies - 1 through 6 (of 6 total)
  • I’m looking for something like that to change the body class … did you find the solution ? Thx

    Looking for a solution to this too. Body classes are EXTREMELY important for my builds.

    Any update on this? I need this as well.

    Many themes rely on the different body classes generated by WordPress, they should be able to be updated to the current page…

    My work around is to put the WP generated body classes from body_class() on a div inside the #site-wrap div I am using in the “Content Element ID” setting.

    Note that anything (such as classes) on the element you’re using for the “Content Element ID”, and outside of it doesn’t change.

    So if possible for some of you, it is easier to move body_class() from the body element inside what is actually being “refreshed” on the page so that it gets updated and can be used for CSS and PHP, rather than trying to change anything on the body tag.

    You can’t just use jQuery on “dataa” since it’s not yet a DOM object of browser. The easiest way is to use workaround given by Courtney or parse the jqXHR string using .split function (hard way) which is time consuming 🙂

    Plugin Author Dean Williams


    You need to wrap your content area with a class or id that is constant, you should not ever be binding to the body tag as this will reload everything.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Retrieve Body Class from DATAA’ is closed to new replies.