Click here to Skip to main content
15,886,518 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: Javascript: url in html Pin
Marc Firth18-Aug-09 22:02
Marc Firth18-Aug-09 22:02 
GeneralRe: Javascript: url in html Pin
msn9219-Aug-09 7:23
msn9219-Aug-09 7:23 
GeneralRe: Javascript: url in html Pin
Marc Firth19-Aug-09 21:57
Marc Firth19-Aug-09 21:57 
Questionhow to get object iframe with asp Pin
ranuth18-Aug-09 17:52
ranuth18-Aug-09 17:52 
AnswerRe: how to get object iframe with asp Pin
Marc Firth18-Aug-09 22:00
Marc Firth18-Aug-09 22:00 
QuestionTransfer JavaScript Array between pages Pin
Joshua Henderson18-Aug-09 17:16
Joshua Henderson18-Aug-09 17:16 
AnswerRe: Transfer JavaScript Array between pages Pin
Marc Firth18-Aug-09 21:52
Marc Firth18-Aug-09 21:52 
GeneralRe: Transfer JavaScript Array between pages Pin
Joshua Henderson20-Aug-09 2:23
Joshua Henderson20-Aug-09 2:23 
Thanks for the reply.

What I am doing as a solution is turning the array into one long string, using AJAX to store it in a PHP session, moving to another page and then having PHP process it when it restores the session.

Basically, the code I am using to turn the array into a string is:

function convertTwoDimensionArrayToString(arrayToConvert) {
	arrayAsString = "7"
	for (i in arrayToConvert) {
		for (j in arrayToConvert[i]) {
			arrayAsString += "%%" + arrayToConvert[i][j];
		}
	}
	return arrayAsString;
}


Because it is a two dimensional array, I need to run the for loop twice, but that said, it will put everything into one long, string (obviously). To turn it back into a two dimensional array, I have used the first index (0) to define the array length so the second dimension in every array in this case has a length of 7. I don't know if I explained my logic that well, but it makes sense to me Wink | ;)

This will ONLY work if the second dimension in the array is always the same length (and in my case, it ALWAYS will be, there would be a major flaw in the program if there wasn't). If the second dimension in the array varies in length, I would change the code to separate the different index's of the second array differently to how I would separate the different index's of the first array.

It definitely does work (and it gives me a way to get the array from javascript to php without too problems as well!), but it isn't the most elegant solution. Just thought I would share my solution with others!
GeneralRe: Transfer JavaScript Array between pages Pin
Marc Firth20-Aug-09 2:47
Marc Firth20-Aug-09 2:47 
Questionhow to show an Alarm ? Pin
Lagziyan18-Aug-09 3:23
Lagziyan18-Aug-09 3:23 
QuestionClosing page in Java Script Pin
Hakmeh Mohannad17-Aug-09 20:53
Hakmeh Mohannad17-Aug-09 20:53 
AnswerRe: Closing page in Java Script Pin
Marc Firth17-Aug-09 23:48
Marc Firth17-Aug-09 23:48 
GeneralRe: Closing page in Java Script Pin
Hakmeh Mohannad18-Aug-09 0:11
Hakmeh Mohannad18-Aug-09 0:11 
GeneralRe: Closing page in Java Script Pin
Marc Firth18-Aug-09 0:13
Marc Firth18-Aug-09 0:13 
AnswerRe: Closing page in Java Script Pin
nacool31-Aug-09 0:54
nacool31-Aug-09 0:54 
QuestionAccessing remote window HTML elements via getElementsByTagName [modified] Pin
Art K17-Aug-09 11:26
Art K17-Aug-09 11:26 
QuestionVolunteer FD Seeking Help in designing small training website Pin
MadFrenchieFire17-Aug-09 6:49
MadFrenchieFire17-Aug-09 6:49 
AnswerRe: Volunteer FD Seeking Help in designing small training website Pin
David Mujica17-Aug-09 8:06
David Mujica17-Aug-09 8:06 
GeneralRe: Volunteer FD Seeking Help in designing small training website Pin
MadFrenchieFire17-Aug-09 8:21
MadFrenchieFire17-Aug-09 8:21 
GeneralRe: Volunteer FD Seeking Help in designing small training website Pin
Marc Firth17-Aug-09 23:25
Marc Firth17-Aug-09 23:25 
QuestionEnterprise Java Bean help Pin
crain198117-Aug-09 6:24
crain198117-Aug-09 6:24 
Questionhow to edit more then 10000 html pages. Pin
Member 311322517-Aug-09 2:06
Member 311322517-Aug-09 2:06 
AnswerRe: how to edit more then 10000 html pages. Pin
Marc Firth17-Aug-09 2:35
Marc Firth17-Aug-09 2:35 
GeneralRe: how to edit more then 10000 html pages. Pin
Member 311322517-Aug-09 3:12
Member 311322517-Aug-09 3:12 
GeneralRe: how to edit more then 10000 html pages. Pin
Anurag Gandhi17-Aug-09 6:02
professionalAnurag Gandhi17-Aug-09 6:02 

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.