javascript - Best DOMContentLoaded fallback -


what best way fallback of domcontentloaded not supported < ie9?

document.addeventlistener('domcontentloaded',function(){/*code here*/}) 

from mdn:

internet explorer 8 supports readystatechange event, can used detect dom ready. in earlier version of internet explorer, state can detected regularily trying execute document.documentelement.doscroll("left"), snippet throw error until dom ready.


Comments

Popular posts from this blog

vb.net - Alternative to the T-SQL AS keyword -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

ios - CFRelease causing crash in iPad application -