JavaScript Versus PHP
Posted by clifton on 18 May 2007 in Tasks
I've spent some time reviewing how the Philosophy website uses PHP to rip the Philosophy course listings from the UVic Calendar website. It creates a(n) .inc file of a JavaScript array and then includes it in the header for each page and then when the page loads JavaScript interprets the array.
I was thinking that the one downside to this is that if an individual has JavaScript disabled they will not be able to view any course information. Seeing that the new functionality that I plan to implement will not be JavaScript based this could be a perfect opportunity to improve upon how PHP rips the course listings and have a PHP array written to the .inc file. This will allow for PHP interpret the course listing so that even if JavaScript is disabled any one using the website can view the information.
I plan to improve upon how PHP rips the course listing by making it so that the correct calendar year is automatically generated instead of manually entered every year. Also by fixing up the variable names and comments it will allow for easier maintenance. Lastly, perhaps I will be able to use 2 dimensional arrays to separate undergraduate courses from graduate courses.
I will be talking with Stewart more about this idea after the long weekend.
I was thinking that the one downside to this is that if an individual has JavaScript disabled they will not be able to view any course information. Seeing that the new functionality that I plan to implement will not be JavaScript based this could be a perfect opportunity to improve upon how PHP rips the course listings and have a PHP array written to the .inc file. This will allow for PHP interpret the course listing so that even if JavaScript is disabled any one using the website can view the information.
I plan to improve upon how PHP rips the course listing by making it so that the correct calendar year is automatically generated instead of manually entered every year. Also by fixing up the variable names and comments it will allow for easier maintenance. Lastly, perhaps I will be able to use 2 dimensional arrays to separate undergraduate courses from graduate courses.
I will be talking with Stewart more about this idea after the long weekend.