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 : how can i get array in different ways? -


hi have little problem javascript can make simple way execute content of array different character of word? example :

var word = new array(); word [0] = "is"; word [1] = "am"; . . . . word [100] = "when"; 

var word should access 3 ways,in order reduce process execute arrays..

first : " "+ word +" "; second : " "+ word; third : word +" "; 

-thank helping-

i'm not sure chasing (fill me in , i'll update), i'd point out far better way of filling in array literal...

var word = [    'is',    'am' ]; 

you can see index calculated automatically, , not required repeat var name each member definition.

update

maybe want can call , next array member each time. should it...

function getnextmember(array, startindex) {    startindex = startindex || 0;     return function() {       startindex++;         return array[startindex];    };  };  var getnextword = getnextmember(word);  alert(getnextword() + ' ' + getnextword()); 

see on jsfiddle.

and of course, if feeling naughty, add function array's prototype.


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 -