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.

performance - Javascript and website loading time optimization -


i know best practice including javascript having code in separate .js file , allowing browsers cache file.

but when begin use many jquery plugins have own .js, , our functions depend on them, wouldn't better load dynamically js function , required .js current page?

wouldn't faster, in page, if need 1 function load dynamically embedding in html script tag instead of loading whole js js plugins?

in other words, aren't there cases in there better practices keeping our whole javascript code in separate .js?

it seem @ first glance idea, in fact make matters worse. example, if 1 page needs plugins 1, 2 , 3, file build server side plugins in it. now, browser goes page needs plugins 2 , 4. cause file built, new file different first one, contain code plugin 2 same code ends getting downloaded twice, bypassing version browser has.

you best off leaving caching browser, rather trying second-guess it. however, there options improve things.

top of list using cdn. if plugins using popular ones, chances being hosted cdn. if link cdn-hosted plugins, visitors hitting site first time , have happened have hit site that's using same plugins same cdn, plugins cached.

there are, of course, other things can to speed javascript up. best practice includes placing script include tags close bottom of document possible, not hold page rendering. should lazy initialization. involves, stuff needs significant setup work, attaching minimalist event handler when triggered removes , sets real event handler.


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 -