• Resolved morantivo

    (@morantivo)


    I wrote script and it’s work until i activate the autoptimize and when i un-tick the Optimize JavaScript Code it’s work so i understand that i need to Exclude scripts from Autoptimize
    the script in this folder \wp-content\themes\blabla\ajax
    one script name ajax.php and the other script.js

    the script.js start with
    jQuery(document).ready(function () {
    const elements = jQuery(‘.ajax-loading-content’)
    setTimeout(() => {
    elements.each((index) => {
    const element = elements[index]
    const postId = jQuery(element).attr(‘data-postId’)
    getContent(postId, (content) => {
    jQuery(element).html(content)

    and the ajax.php start with

    jQuery(document).ready(function () {
    const elements = jQuery(‘.ajax-loading-content’)
    setTimeout(() => {
    elements.each((index) => {
    const element = elements[index]
    const postId = jQuery(element).attr(‘data-postId’)
    getContent(postId, (content) => {
    jQuery(element).html(content)

    i tried to exclude the folder \wp-content\themes\blabla\ajax but it’s not working
    i think i didn’t understand how to do

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Exclude scripts from Autoptimize: (my own script)’ is closed to new replies.