Forum Moderators: open
slide[0] = "image1,image1.jpg,350,262,Young Wild Things tour 2007 featuring Cute Is What We Aim For and other popular bands,William Badarak-The North Star";
slide[1] = "image2,image2.jpg,273,350,North one acts a scene from Cassie Geists performance entitled Bus Stop,Jacob Gray-The North Star";
For element number 4 (counting from 0 up), I really need to be able to use characters such as quotes (") and commas (,) but my code does this later:
var strArray = slide[i].split(",");
to get the data apart.
I've tried escape() but I don't think that's right. How can I do this? Also, if I include quotes (") it closes up the array and messes everything up.
Ideas?
Thanks so much!
e.g.
slide[0] = 'image1,image1.jpg,350,262,Young Wild Things tour 2007 featuring Cute Is What We Aim For and other popular bands,William Badarak-The North Star';
If there's an apostrophe in the string, escape it
e.g.
A Dog's Dinner
A Dog\'s Dinner
For the commas, maybe you could use HTML 4.0 Latin-1 entities equivalents as a workaround
‚ OR ‚ OR ‚
slide[1] = new Array()
slide[1][0] = "image2";
slide[1][1] = "image2.jpg";
slide[1][2] = "273";
slide[1][3] = "350";
slide[1][4] = "it's got \"quotes\" in it, too";
slide[1][5] = "more, more, more";
then you don't need to worry about using split() to parse array elements later
i'm ultimately trying to make a php script put together a .js file from some form data.
I suppose using httpwebwitch's solution and having a finite number of pieces of data to enter for each array element I could do that rather easily actually.
For example, do something like this:
slide[0] = new Array();
slide[0][0] = "<?php echo $description; ?>";
slide[0][1] = "<?php echo $filename; ?>";
slide[0][2] = "<?php echo $width; ?>";
...and so on. Side question kinda...would that work?