Eliminating Render Blocking Scripts
-
Please help to make sure what the following code is wrong.
// // Eliminating Render Blocking Scripts // function optimize_jquery() { if (!is_admin()) { wp_deregister_script('jquery'); wp_deregister_script('jquery-migrate.min'); wp_deregister_script('comment-reply.min'); $protocol='http:'; if($_SERVER['HTTPS']=='on') { $protocol='https:'; } wp_register_script('jquery', $protocol.'//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js', false, '3.6', true); wp_enqueue_script('jquery'); } } add_action('template_redirect', 'optimize_jquery'); }
The result is as below.
The code snippet you are trying to save produced a fatal error on line 20:
syntax error, unexpected ‘}’, expecting end of file
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Eliminating Render Blocking Scripts’ is closed to new replies.