Why is jQuery.ready recommended when it’s so slow?

To the point first: No, there is no disadvantage in calling you init before closing the <body>. It will as you have noticed perform better that relying on $.ready() and will also work with all the browsers flawlessly (even on IE). Now, there are however reasons to use $.ready(), which in your case they do … Read more

javascript:how to write $(document).ready like event without jquery

This is the way jQuery wraps the functions you’re looking for – the snippet does not need jQuery, and is cross-browser compatible. I’ve replaced all calls to jQuery.ready() with yourcallback – which you need to define. What goes on in here: first, the function DOMContentLoaded is defined, which will be used when the DOMContentLoaded event … Read more

How to know when font-face has been applied

I found a solution after wondering why IE doesn’t suffer from this problem. Firefox and Chrome/Safari triggers the DOMContentLoaded event before font-face is applied, thus causing the problem. The solution is to not listen for DOMContentLoaded but instead go oldschool and listen to onreadystatechange and wait until the document.readyState === ‘complete’ which is always triggered … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)