JavaScript

Posts related to JavaScript

How to remove render blocking JavaScript with defer and async

With HTML5 there are 2 new boolean attributes for <script> tag which indicates to the browser how the script should be evaluated. The 2 attributes are defer and async. Using these attributes can help improve the page load time by downloading the script in parallel when the page is being parsed and then executing it …

How to remove render blocking JavaScript with defer and async Read More »

Get various parts of URL using JavaScript

Recently I wanted to get a domain name of the page on which I was currently on. I was trying to parse the entire URL of the page and then parse it using regular expressions etc. to get the domain name. I was able to get the required information using this method, but then I …

Get various parts of URL using JavaScript Read More »

Cachebuster code in JavaScript

The JavaScript, CSS and other files used in a website are often cached by the browser. Sometimes we might want the browser to always fetch the file from the server instead of from the cache. To do this we can use a cachebuster code to make the browser think that every time it is fetching …

Cachebuster code in JavaScript Read More »