Can jQuery be used to automatically post and remove content based on date?

What is the best way to automatically post and remove content to a website based on date?

For instance… i have an upcoming event box on my homepage… instead of manually updating the box a few times a month… is it possible to use a bit of jQuery to automatically post the latest upcoming event… when the events’ date expires… i would like the next upcoming event to automatically take its place.

ideas?

fyi - my site is a static html5 website. i am open for other suggestions as well. thanks.

It will not save the file, jQuery is just a JavaScript library. JavaScript is client side. You should probably use a CMS, which would make updating the page easier, since you would be able to use a nice graphics interface.

You could have a data file, that you populate with events, so that scripting can then use the JSON protocol to read in that data and do things based on it.


{
    "events":[
        {
            "event":"Event 1",
            "date":"3/20/2013"
        },
        {
            "event":"Event 2",
            "date":"3/30/2013"
        },
        {
            "event":"Event 3",
            "date":"4/6/2013"
        }
    ]
}

You could then easily have javascript read in that json data, and loop through the events looking for the most recent upcoming event.

That way, it is only the contents of that data file that would need to be edited, which is a simple way of doing things.