简体   繁体   中英

Eliminate render blocking javascript

I want to improve the performance of a web page on mobile devices by eliminating render blocking javascript from above the fold content as advised by google page speed insights. All the javascript files the page uses are for a text box towards the top of the page where users select ingredients :

jquery-1.8.2.js, textext.js, home.js

I tried moving all these files to the end of the html, but it caused the textbox to break. I also tried using the async attribute for the scripts but this had the same effect. Is there any way I can fix this problem? The page is here .

A possible direction can be finding the specific blocking functions (for example, alert ). Then overriding those with non-blocking ones, by implementing them before the current code is executed.

For example, you can implement alert as a modal, allowing the rendering to continue fluently.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM