Session Time Out Notifier (PHP, Jquery)

Posted December 14th, 2010 in JQuery, PHP, Toolbox, Web Development by Jonathan

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.

Continue Reading »

Toolbox – Ajax requests and caching

Posted March 4th, 2010 in Featured, JQuery, Toolbox, Web Development by Jonathan

Today was a reminder of how much I can forget. I have been working on a quick little report to help a group of people here at work. Nothing special, but I was adding some nice functionality to make updating things easier.

Basically each result row had 2 check boxes. Where they could check or uncheck either of them and it would update a table in the background. No biggie I thought, of course I had been developing it in Firefox and Chrome and occasionally in IE 8, and everything previous to the check boxes worked fine in all the browsers.

Continue Reading »

Toolbox – Insert Text into TinyMCE at cursor

Posted November 25th, 2009 in Featured, JQuery, Toolbox, Web Development by Jon

In my mind, I can hear the them to Picture Pages playing in the background – because I want to remind you that in my quest to be a better web developer (and share with the world) I started this “toolbox” so I could keep a cataloged stockpile of simple easy to use tricks to make my life easier – plus I wanted to share…

This is documented somewhere on TinyMCE’s site, but it’s may not be easy to find. It’s simple little trick that I use as a helper to a simple image manager to go along with TinyMCE (since you have to pay for an image manager).

In my day to day life, it seems like I need a backend to every site I build, no one wants simple pages anymore. So I end up with a lot of forms, which have a lot of textareas in them. I like using TinyMCE as the wysiwyg editor for those textareas. This also calls for adding images and TinyMCE charges for the built in feature above using a url for an image. This presented me with a problem, I have end users who aren’t savvy enough to upload images (FTP) and then get the url to add the image to the editor, but they want images.

Continue Reading »

ToolBox – Preloading With Jquery

Posted November 12th, 2009 in Featured, JQuery, Toolbox by Jon

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]);
  }
}

Continue Reading »

Parsing what's dished out (I'm looking at you Godaddy)

Posted October 23rd, 2009 in JQuery, Web Development by Jon

It’s no secret – well if you’ve been listening to me for the past few days, that I’ve been upset with GoDaddy’s free web hosting. I have a side project for a client, and it needed an admin back end done – something to edit the pages, nothing crazy or too difficult and since I love JQuery, I add in some eye candy because it makes it easier to use.

Well as I’m cruising along, certain things that I’m use to doing a certain way just aren’t working. I narrowed down what I thought the problem was and it points right to the stupid ad banner that GoDaddy uses – well more to the point the mechanism they employ to add it to the pages.

It goes as far as attaching to an AJAX request reponse. So when you send your request and you get back a nice little JSON object back, it has some iframe crap stuck to the end of it. It really through me for a loop for awhile. Luckily Scott (and old coworker and friend of mine) got me pointed in the right direction.

Continue Reading »