Click here to Skip to main content
15,888,351 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: Help with my statement. Pin
Peter Leow18-Jan-14 20:29
professionalPeter Leow18-Jan-14 20:29 
GeneralRe: Help with my statement. Pin
Yhen Caisip18-Jan-14 20:48
Yhen Caisip18-Jan-14 20:48 
GeneralRe: Help with my statement. Pin
Peter Leow18-Jan-14 21:04
professionalPeter Leow18-Jan-14 21:04 
GeneralRe: Help with my statement. Pin
Yhen Caisip18-Jan-14 21:27
Yhen Caisip18-Jan-14 21:27 
GeneralRe: Help with my statement. Pin
Yhen Caisip18-Jan-14 21:36
Yhen Caisip18-Jan-14 21:36 
GeneralRe: Help with my statement. Pin
Yhen Caisip18-Jan-14 21:51
Yhen Caisip18-Jan-14 21:51 
GeneralRe: Help with my statement. Pin
Yhen Caisip18-Jan-14 23:21
Yhen Caisip18-Jan-14 23:21 
QuestionAdding Var Object to An Array Dynamically Pin
ASPnoob17-Jan-14 9:39
ASPnoob17-Jan-14 9:39 
Hi all,
I know that normally one can add string(s) to an array upon declaring the array by placing the string or strings inside the parenthesis, surrounded by double quotes and separating them with a comma. However, I would like to dynamically add them by doing the following but I cannot get it to work:
JavaScript
var stringArray[] = new Array(3);

//Declaring string objects
vary string1 = "First";
vary string2 = "Second";
vary string3 = "Third";

//Then in a for loop add each string to the array
for(x=0; x<stringArray.length-1; x ++)
{
//Add string
stringArray[x]= "string" + x+1;
}

Please explain why the code above does not work, in detail thanks.

modified 17-Jan-14 21:23pm.

AnswerRe: Adding Var Object to An Array Dynamically Pin
Graham Breach17-Jan-14 22:15
Graham Breach17-Jan-14 22:15 
GeneralRe: Adding Var Object to An Array Dynamically Pin
ASPnoob18-Jan-14 4:39
ASPnoob18-Jan-14 4:39 
AnswerRe: Adding Var Object to An Array Dynamically Pin
Hassan Oumar Mahamat31-Jan-14 3:24
professionalHassan Oumar Mahamat31-Jan-14 3:24 
QuestionQuery string null in redirects Pin
Vimalsoft(Pty) Ltd15-Jan-14 5:20
professionalVimalsoft(Pty) Ltd15-Jan-14 5:20 
QuestionRe: Query string null in redirects Pin
ZurdoDev21-Jan-14 5:04
professionalZurdoDev21-Jan-14 5:04 
Questionconvert krutidev to unicode Pin
Priyanka_a7-Jan-14 22:38
professionalPriyanka_a7-Jan-14 22:38 
QuestionFor non-programmer, Implementing following specific code example - Using JSON and File API to View Starred Google Reader Posts Pin
Member 1048791825-Dec-13 21:24
Member 1048791825-Dec-13 21:24 
SuggestionRe: For non-programmer, Implementing following specific code example - Using JSON and File API to View Starred Google Reader Posts Pin
Richard MacCutchan28-Dec-13 23:29
mveRichard MacCutchan28-Dec-13 23:29 
GeneralRe: For non-programmer, Implementing following specific code example - Using JSON and File API to View Starred Google Reader Posts Pin
Member 104879183-Jan-14 6:01
Member 104879183-Jan-14 6:01 
AnswerRe: For non-programmer, Implementing following specific code example - Using JSON and File API to View Starred Google Reader Posts Pin
Manuel F. Hernandez15-Jan-14 7:33
Manuel F. Hernandez15-Jan-14 7:33 
QuestionTiming issue? Pin
#realJSOP24-Dec-13 5:12
mve#realJSOP24-Dec-13 5:12 
AnswerRe: Timing issue? Pin
twseitex28-Dec-13 8:53
twseitex28-Dec-13 8:53 
QuestionBackbone Pin
Rockerr Black23-Dec-13 22:18
Rockerr Black23-Dec-13 22:18 
AnswerRe: Backbone Pin
Richard MacCutchan24-Dec-13 0:52
mveRichard MacCutchan24-Dec-13 0:52 
AnswerRe: Backbone Pin
Rahul Rajat Singh29-Dec-13 20:50
professionalRahul Rajat Singh29-Dec-13 20:50 
AnswerRe: Backbone Pin
joginder-banger9-Jan-14 22:54
professionaljoginder-banger9-Jan-14 22:54 
QuestionDisplay the server time and refresh every 1 sec using Javascript in asp.net Pin
G.Mariappan(a)Murugan23-Dec-13 18:41
G.Mariappan(a)Murugan23-Dec-13 18:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.