开发者

Alternative to before </body> tag inline Javascript

开发者 https://www.devze.com 2022-12-27 23:53 出处:网络
I know inline Javascript is frowned upon and with the new on-the-fly Javascript compressors that check for idle/unused function usage and omit the unused code, it seems good practice to have all your

I know inline Javascript is frowned upon and with the new on-the-fly Javascript compressors that check for idle/unused function usage and omit the unused code, it seems good practice to have all your Javas开发者_开发问答cript in an external file.

My question is, in situations like FOUC (flash of unstyled content) which usually require little snippets of code right before the closing </body> tag, is there a JQuery resolution that would serve the same purpose, but from a remote Javascript file linked in the <head> of the document?


Is $(document).ready() what your looking for?

$(document).ready(function() {
    // anything in here will execute when the page has finished loading
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号