Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

javascript - Is there any way to detect when a CSS file has been fully loaded? -


i've been testing lot of lazy-loaders javascript , css insert <script> , <link> tags load files. problem is, <link> tags don't fire onload it's difficult detect when they're loaded. workaround found set display: none; (in css file loaded) on dummy element , poll element check when has been set display: none. that, apart being ugly, of course works single css file.

so wondering; there other way detect if css file has been loaded?

thanks, lukas

--

ps: found solution, it's @ bottom of page. (i'm new stackoverflow , i'm sure answer supposed @ bottom, think overseen if googleusers stuble upon page, wrote little note)

edit: should noted browser support onload events on css files has improved since original answer. not supported though, answer below still has relevance. here compatibility chart, not sure how legit source though.

ok, found solution.

this guy http://tugll.tugraz.at/96784/weblog/9080.html inserts link-tags , polls document.stylesheets[index].rules until no longer undefined (where index of course index of newly inserted file). unfortunately code buggy , works safari & ff. fixed bugs, added functionality opera , internet explorer , added features adding multiple css , js files , 1 final callback (when files loaded) in sweet , simple lazyloader-function. result can found here:

https://github.com/lukasbombach/lazyloader


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -