Dec 7, 2013

Loading blog modules dynamically

I just want to share a little trick that I have applied to my blog a few days ago. If you have a blog like mine, in which you talk about everything, and maybe in some of the posts you need to use a code highlighter, a math or graphics renderer, or any other kind of scrpt, but in other posts you don't need them at all, maybe you noticed for sure that loading that scripts from beginning in every page that your readers visits in your website, will slow down the page charging, and therefore will degrade the user experience in your website.
So, my idea is to load only the scripts that I need, and enable or disable them with a few minimal code. This trick can be applied to any kind of template of Blogger because the following code doesn't requires to modify it.