}

How to Reduce JavaScript execution Time in Google Page Speed



Reduce JavaScript execution



JavaScript has become very popular these days to use on websites, from loading dynamic data or adding special effects to your blog or web pages through AJAX.

But, unfortunately, you have to make a big deal in order to use these features.


You must sometime have to rely on heavy JavaScript libraries and that can add extra kilobits to your pages.

As a result, your blog starts to take time in order to load your web pages and almost every one of us hates, a slow loading site, and this can affect your site’s SEO.

So, if you have analyzed your blog using Google PageSpeed Insights or GT Matrix and found this issue.

In Google PageSpeed Insights if your site speed is between:

0 to 49 - Red Signal, which means that your site loads slow.


Reduce JavaScript execution


 50 to 89 - Orange Signal, which means that your site has an average speed, and


Reduce JavaScript execution


90 to 100 Green Signal and that means your blog load fast.

Reduce JavaScript execution

Don’t Worry!

You can solve this issue by simply replacing a code snippet and speed up your blog’s page speed.

Also, learn: How to remove the date from Blogger URL

How to Solve JavaScript execution Time in Google Page Speed Insights


Follow the below steps and you will be done within no time.

Step 1. Login to your Blogger blog and select Template/Theme and click on Edit HTML.

Reduce JavaScript execution

Step 2. Now search for ajax.googleapis.com 


Reduce JavaScript execution

You will find either any one of it or maybe both if you have added on your theme. (See below images). 

Reduce JavaScript

Step 3. Now select/delete the entire jQuery script and replace it with the below script.

  <script id='script-batch' type='text/javascript'>  
     (function(d){  
       var js = d.createElement(&#39;script&#39;); js.async = true; js.defer = true;  
       js.src = &quot;https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js&quot;;  
       d.getElementsByTagName(&#39;head&#39;)[0].appendChild(js);  
     }(document));  
  </script>  

Step 4. Click on Save in order to save your setting.

Now, head back to Google PageSpeed Insights or GT Matrix and check once more. I am sure your blog’s page speed has increased, right!

Also, learn: How to remove date and time header form Blogger posts



Conclusion

I hope your blog has successfully acquired the green signal in the test and if this small tutorial has helped you in any way. Then, do us a favor by sharing this post on social networking sites.

And let me know, what was your previous score before replacing jQuery and the score after adding this code.






4 comments:

  1. great one, today i got to know where to check website speed. Thanks great information

    Personal blog

    ReplyDelete
  2. Hey Krish,
    I found your blog extremely helpful I found the solutions for many pagespeed related problems like lazy loading and I have used a search bar provided by you. But I have another problem.
    I have tried solution you provided to reduce javascript execution time it worked for me but it will be more helpful for me if you can help me to reduce the javascript execution time for my blog https://www.siptolumpsum.net I found Javascripts like google apis, translate google apis, google tag manager,google analytics. It take much time to execute in my blog.
    Keep writing your blog it is very helpful to many newbies.

    ReplyDelete
    Replies
    1. Thanks Gaurav for kind words about my blog. I have analyzed your blog in Google PageSpeed.
      Your Desktop view is 100% but you have to work on mobile optimization, you have not replaced the jQuery and some of your images are more than 265 kb. Mail me on info@wonderkrish.com

      Delete