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 - Prototype and jQuery concatenation failure -


edit: i've taken jquery , prototype libs out of equation, problem still remains.

simplified test case 1 - without concatenation
$ function decalared using window.$ in a.js, , declared in function notation in b.js. b.js loaded second, , overwrites a.js $ function

simplified test case 2 - with concatenation
combined a.js , b.js, first, , b second. function declaration


i found strange when trying concatenate prototype , jquery. seems though when concatenated, $ jquery reference doesn't overwritten prototype. i've built 2 test cases single out, , it's failing in chrome8 , ff 3.6.

test case 1 - without concatenation
jquery , prototype loaded separately different script tags. jquery loaded first, prototype second.

test case 2 - with concatenation
jquery , prototype concatenated single file, , loaded single script tag. jquery first in script, , prototype added second.

these should act identically, second test throwing errors because $ function in prototype doesn't overwrite $ jquery reference.

did set these wrong, or browsers rendering javascript differently when it's in same file?

the $ function in prototype instantiated function declaration:

function $(element) { 

since prototype library not in closure, assumed scope window. variable , function declarations hoisted top of scope, "function $" declared, , $ variable overwritten jquery.

here's fiddle: http://jsfiddle.net/psc7s/


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 -