I was wondering if anyone could help me with this:
I have a list of quotes held in a data table and they are accessed randomly every time a page loads through a template containing JavaScript. I am currently reading the rows with a switch statement:
switch(selectedQuote) {
case 1:
quote = stripTNR("<!wem record=0 datafield.0 HTMLSTRING>");
break;
The data table is growing rapidly and so is the switch statement so I was wondering if there was any way I could replace the <!wem > statement with something like:
quote = stripTNR("<!wem record=/""+selectedQuote+"/" datafield.0 HTMLSTRING>");
The above code currently just returns the 1st line of the data table only.
If this is not possible is there any other way of randomly selecting a row fro the data table?
Thanks,
Amy
I have a list of quotes held in a data table and they are accessed randomly every time a page loads through a template containing JavaScript. I am currently reading the rows with a switch statement:
switch(selectedQuote) {
case 1:
quote = stripTNR("<!wem record=0 datafield.0 HTMLSTRING>");
break;
The data table is growing rapidly and so is the switch statement so I was wondering if there was any way I could replace the <!wem > statement with something like:
quote = stripTNR("<!wem record=/""+selectedQuote+"/" datafield.0 HTMLSTRING>");
The above code currently just returns the 1st line of the data table only.
If this is not possible is there any other way of randomly selecting a row fro the data table?
Thanks,
Amy