Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

Thursday, October 3, 2013

A Script to Display Date & Time Using JavaScript

You can use it for your webpage/blog, too!

Just a few hours ago, I was thinking to add a plain 'date and time' widget to this blog. After a bit of searching, I finally found a site with the exact script. But unfortunately, it didn't really meet my standard.


As you can see, there's no comma after the name of the day, and it doesn't really look that good in my eyes. My own preference would be the one displayed on the right side of this very blog. Yup, that one.

Moreover, if you check the script, you'll notice that it requires two separate files; one for the .js file and one for the HTML to load the .js file.

Seeing that blogger doesn't provide file hosting (except for photos and videos), and it's way too complicated to host the .js file outside of Blogger server (and I'm a lazy ass to begin with), so I thought, "Ah, what the hell..." and decided to slightly alter the script, so that it can work on Blogger's HTML/JavaScript widget just fine. Besides, it's a short script anyway. So, why not?

tl;dr - Here's the altered script. But before that, click the 'read more' below first, will ya?