Is it possible to hide dynamically created arrays from the page source? I mean, when a user does a “view page source”, he should not see all the values of the javascript array (looks quite ugly, not to mention the answers are visible).
Here is what I am doing:
- Fetch the data from DB (e.g. multiple questions)
- Create the javascript array with the questions
- Use javascript to cycle through the questions one at a time
There are 4 reasons for doing this:
- There should be zero lag between the questions (doesnt matter if it takes some time to load all the questions)
- There are shared variables (e.g. a countdown timer) between the questions
- Each question maybe “reviewed” immediately (hence the need for the correct answers).
- All the questions and the user answers are again displayed for review at the end.
Is there are better way of doing that than what I am doing? I think there should be.
If you use Ajax to fetch the data, it will not be seen by those viewing “page source”.