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.

How do I access the first key of an ‘associative’ array in JavaScript? -


i have js 'associative' array,

array['serial_number'] = 'value' 

serial_number , value strings. e.g. array['20910930923'] = '20101102'

i sorted value, works fine. let's object 'sorted';

now want access first key of 'sorted' array. how do it? can't think need iteration with

for (var in sorted) 

and stop after ther first one...

thanks

edit: clarify, know js not support associative arrays (that's why put in high commas in title).

javascript object properties specified have no order, much though many people wish different. if need ordering, abandon attempt use object , use array instead, either store name-value objects:

var namevalues = [     {name: '20910930923', value: '20101102'},     {name: 'foo', value: 'bar'} ]; 

... or ordered list of property names use existing object:

var obj = {    '20910930923': '20101102',    'foo': 'bar' };  var orderedpropertynames = ['20910930923', 'foo']; 

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 -