This morning I had to format a date using JavaScript as follows: yyyymmdd requiring both the month and day to include a leading zero when the month or day was less than 10. This solution using slice multiple times.
Tag: Javascript
-
Javascript, the Back Button, and Windows Phone 8 Development
I recently had the opportunity to begin exploring and toying around with Windows Phone 8 development.
Why you ask? Why not really, but mostly because I was giving a free phone and it’s an untapped market when it comes to apps. At this stage it’s not over diluted like the Android and iPhone stores are. That and of course there is an option to create apps using HTML, Javascript, and CSS – technologies I’ve used and mastered for years!
I actually submitted my first app last weekend – and sadly – it got rejected 🙁 I was given two reasons; firstly I did set a default application icon, whoops my bad. Secondly, I didn’t properly handle the back button since there are “multiple pages” in my application.
It took me several hours to finally found the answer so I thought I would share it. Please note, this feels like a bit of a hack, but I wasn’t able to get the “suggested” solutions working…
-
JavaScript: Easy Creation of “Countdown Timers”
If there is one thing I don’t like doing – it’s doing the same thing twice or even more! So I was building an application on the side where I need to have a listing that performs a simple countdown. At this point I’ve been lazy and just have it counting down the seconds, but this example would be really easy to update to put a proper countdown of days, hours, minutes, and seconds – and heck if you get really adventurous even weeks, months, and years! -
Facebook Development – Quick and Easy Dialogs
At my work, whenever we have a link to delete records, we always have a simple Javascript confirm dialog pop-up. The confirm dialog just does the standard, “Are you sure you wish to delete this record?” with an OK and Cancel button. If the user clicks cancel, the record is not deleted, if they click OK, the record will be deleted.
If you’ve done some Facebook development, you will notice quickly that the alert() and confirm() functions do not work. I’ve found this slightly annoying, so I’ve written a very simple Javascript function that let’s me use the nifty dialogs that Facebook provides us. (more…)
-
Drag and drop with animations in jquery
Every year at Halloween, my company offers prizes to the best dressed employees. For the past two years I have won as well as my co-worker that partakes in our crazy costumes. You may be wondering what this has to do with drag and drop, don’t worry I’m getting.
This years prize happened to be a monkey slingshot. Basically you place your index and middle fingers in pockets attached to the monkey’s arms. You then proceed to pull back and let fly. Well, as you can imagine, we had a lot of fun with this guy, so much fun in fact we broke it 🙁
So one day after work I was messing around with drag and drop and some jQuery tutorial animations. I was quickly able to get a “mock slingshot” shooting at a target and this is what I want to share today. (more…)