I have an html web page that displays a box with question and answer fields. I have one JavaScript program that contains all the questions and operational functions. (All learnt in the last 18 months).
The user initially selects a set of questions by a radio button, and setting the initial selection results in the chosen questions being copied into the question and answer arrays.
As more sets of questions are added, I thought it would be better management to have the different sets of questions in text files (obviously on the server) separated from the function code.
I can't quite see how to do this; as clearly, it's not so straight forward, as the JavaScript is downloaded to the users browser - so how can it access a file?
I'm prepared to do the homework, but can you please advise me as to how I might possibly go about this task of separating out the coded questions from the function code.
The user initially selects a set of questions by a radio button, and setting the initial selection results in the chosen questions being copied into the question and answer arrays.
As more sets of questions are added, I thought it would be better management to have the different sets of questions in text files (obviously on the server) separated from the function code.
I can't quite see how to do this; as clearly, it's not so straight forward, as the JavaScript is downloaded to the users browser - so how can it access a file?
I'm prepared to do the homework, but can you please advise me as to how I might possibly go about this task of separating out the coded questions from the function code.
Comment