Javascript Error After Optimizing speed
-
Hello,
Your plugin works great, and never had any problems with it. until I started optimizing for google page speeds. one of the suggestions from google is move scripts to the footer. and while this makes the page load faster, it breaks your plugin.
I found the exact place where we can fix the issue:
Its on the file: Php/class-styles.php line 70
Replacing
wp_add_inline_script( “{$this->plugin->assets_prefix}-ssba”, sprintf( ‘Main.boot( %s );’,
wp_json_encode( array() )
) );With:
wp_add_inline_script( “{$this->plugin->assets_prefix}-ssba”, sprintf( ‘ jQuery(function(){Main.boot( %s );})’,
wp_json_encode( array() )
) );
Fixes the issue in my website since it now waits for the functions and javascript to be loaded.But this is only going to work until I update your plugin again, so I was wondering if you could incorporate this fix or something similar in your plugin for future updates.
Sincerely,
Alex SanabriaThe page I need help with: [log in to see the link]
The topic ‘Javascript Error After Optimizing speed’ is closed to new replies.