So what is going on here?
This is an exercise using Ajax, php, javascript and css sprites.
what exactly is going on?
- There is a server request that gets the date from a php script.
- The date is returned with commas separating it into 3 values.
- Using javascript, this is split into an array.
- Conditional statements are applied (switch() statement) - based on the day/ month/ year to select correct background-position for the day, month, year, div background-image.
- A css sprite is set up that uses one image and background-position
- Coordinates are selected that reveal the correct part of the image that corresponds with the current date.
The whole point?
reduce number of server requests.