For a simple version use the download button to grab it. This is the snazzy version.


I was tooling around mint.com the other day and noticed that after a certain amount of time a notice appeared at the top of the screen to inform me that I was about to be logged out. Then after the time ran out I was returned to the login screen.
A few weeks ago, a coworker was asking if there was a better way to deal with being logged out on a backend system I put together. Once I saw the mint.com system I knew I had to try to build something like it. So I did, it’s not exactly the same because of the system I’m using but it works just as well and looks good doing it – I also wanted it to be a simple addition.
Getting started;
Have some idea of how to use jQuery, I don’t think what I’ve done here is hard – but at least understand some basic concepts like the $(document).ready() function,.fadeIn(),.click(),etc. For PHP, have an idea of $_GET variables, and header locations. Then some knowledge of Javascript itself, and an understanding of loops and counting.
I thought I’d start a new Category called “Toolbox”, specifically for what I use on a daily basis for web development. These are snippets, functions, cheats, etc that anyone can use and make my life as a web developer that much easier…
This installment is something I’ve been using lately to preload images so they don’t spit out the alt text…Mostly it seems to happen when I’m doing something with ajax.
I found this snippet at Matt Farina’s blog.
This is the code (I just made a js file out of it and include it when necessary).
jQuery.preloadImages = function()
{
for(var i = 0; i<arguments.length;i++) {
jQuery("<img>").attr("src", arguments[i]);
}
}
I’m the middle of building a new company website, something that will bring them into the 21st century. With that thought in mind, I need to develop a back end for employees to log in and update their own information. This is of course centered around their log in credentials.
So in the their “dashboard” they can update their password. But if they are like me, sometimes they type faster then they realize and might have hit different keys by mistake, so I thought I would give them the ability to show their password in readable characters if they wanted to. This allows them to check over what they have typed and verify they have what they want. I think it’s easier then using a double password field that just takes more time to fill in – but that’s just me.