Update Body Classes
-
Hi,
I’ve seen previous posts about updating the body classes by adding the below code to the file ajax-page-loader.js
var matches = data.match(/<body.*class=["']([^"']*)["'].*>/), classes = matches && matches[1]; jQuery("body").removeClass().addClass(classes);
This appears to work, which is great. However, surely these changes will be undone when the plugin is updated and isn’t a safe way to achieve this?
In the plugin settings there is mention of this in the “Data Ajax Loaded Code” but no example to follow and the link provided just links to the https://ajaxpageloader.com/, where I can’t find any mention either.
This is a special code block to retrieve additional information from the content, the page loaded Ajax. For example, the styles of the body tag, to update the not recharge.
Is anyone able to provide the code which can be copied into the “Data Ajax Loaded Code” section that will update the body classes?
- The topic ‘Update Body Classes’ is closed to new replies.