Changing a call to a JSON object to make program more abstract
I have a program that builds a number of divs via data in a JSON file. I
call the info in the program like so:
'<p>English test score = ' + division[i].Eng5Thirteen +'</p>'
where Eng is the subject, 5 is the grade and Thirteen is the year (2013).
I do a variation of this a ton of times.
Is there a way to update this program next year by just changing a
variable that stores the word 'Thirteen' to 'Fourteen' and it will reflect
through my whole program so I don't have to change it all next year? Maybe
my whole program is inefficient?
You can see the code here and the running program here.
No comments:
Post a Comment