Recent Posts
Tags
 

Author: Thomas

jQuery Version Check: live() Vs. On()

12:34 31 January in Compatibility, JavaScript, jQuery, Thomas' Toolkit by Thomas

Recently I started work on my own jQuery plugins.  I do love that jQuery.  But, as I was working, I came to see the difference between on() and live(). I'm reading that live() is depreciated, so in order to make my plugin a bit more universal, I wrote a function to detect the jQuery version being used, and act accordingly.  Here it is: function useOn(){ var jRequired = '1.7.1'.split('.'); var jInstalled = jQuery.fn.jquery.split('.'); var on = true; for(x in jInstalled){ if(parseInt(jInstalled[x]) < parseInt(jRequired[x]) && on==true){ on = false; } } return on; } If the jQuery version is 1.7.1 or higher, this function will return true. If lower, it will return false. I call the function when I'm getting ready to set click functions on some of my objects. I couldn't find anything like it will poking around Google, so hopefully someone else finds this helpful. ...

United States JSON state list

10:28 04 February in JavaScript, JSON, Resources, Scripting, Thomas' Toolkit by Thomas

In case anyone needs it. var US = { "AL":{"count":"0","name":"Alabama","abbr":"AL"}, "AK":{"count":"1","name":"Alaska","abbr":"AK"}, "AZ":{"count":"2","name":"Arizona ","abbr":"AZ"}, "AR":{"count":"3","name":"Arkansas","abbr":"AR"}, "CA":{"count":"4","name":"California ","abbr":"CA"}, "CO":{"count":"5","name":"Colorado ","abbr":"CO"}, "CT":{"count":"6","name":"Connecticut","abbr":"CT"}, "DE":{"count":"7","name":"Delaware","abbr":"DE"}, "DC":{"count":"8","name":"District Of Columbia","abbr":"DC"}, "FL":{"count":"9","name":"Florida","abbr":"FL"}, "GA":{"count":"10","name":"Georgia","abbr":"GA"}, "HI":{"count":"11","name":"Hawaii","abbr":"HI"}, "ID":{"count":"12","name":"Idaho","abbr":"ID"}, "IL":{"count":"13","name":"Illinois","abbr":"IL"}, "IN":{"count":"14","name":"Indiana","abbr":"IN"}, "IA":{"count":"15","name":"Iowa","abbr":"IA"}, "KS":{"count":"16","name":"Kansas","abbr":"KS"}, "KY":{"count":"17","name":"Kentucky","abbr":"KY"}, "LA":{"count":"18","name":"Louisiana","abbr":"LA"}, "ME":{"count":"19","name":"Maine","abbr":"ME"}, "MD":{"count":"20","name":"Maryland","abbr":"MD"}, "MA":{"count":"21","name":"Massachusetts","abbr":"MA"}, "MI":{"count":"22","name":"Michigan","abbr":"MI"}, "MN":{"count":"23","name":"Minnesota","abbr":"MN"}, "MS":{"count":"24","name":"Mississippi","abbr":"MS"}, "MO":{"count":"25","name":"Missouri","abbr":"MO"}, "MT":{"count":"26","name":"Montana","abbr":"MT"}, "NE":{"count":"27","name":"Nebraska","abbr":"NE"}, "NV":{"count":"28","name":"Nevada","abbr":"NV"}, "NH":{"count":"29","name":"New Hampshire","abbr":"NH"}, "NJ":{"count":"30","name":"New Jersey","abbr":"NJ"}, "NM":{"count":"31","name":"New Mexico","abbr":"NM"}, "NY":{"count":"32","name":"New York","abbr":"NY"}, "NC":{"count":"33","name":"North Carolina","abbr":"NC"}, "ND":{"count":"34","name":"North Dakota","abbr":"ND"}, "OH":{"count":"35","name":"Ohio","abbr":"OH"}, "OK":{"count":"36","name":"Oklahoma","abbr":"OK"}, "OR":{"count":"37","name":"Oregon","abbr":"OR"}, "PA":{"count":"38","name":"Pennsylvania","abbr":"PA"}, "RI":{"count":"39","name":"Rhode Island","abbr":"RI"}, "SC":{"count":"40","name":"South Carolina","abbr":"SC"}, "SD":{"count":"41","name":"South Dakota","abbr":"SD"}, "TN":{"count":"42","name":"Tennessee","abbr":"TN"}, "TX":{"count":"43","name":"Texas","abbr":"TX"}, "UT":{"count":"44","name":"Utah","abbr":"UT"}, "VT":{"count":"45","name":"Vermont","abbr":"VT"}, "VA":{"count":"46","name":"Virginia ","abbr":"VA"}, "WA":{"count":"47","name":"Washington","abbr":"WA"}, "WV":{"count":"48","name":"West Virginia","abbr":"WV"}, "WI":{"count":"49","name":"Wisconsin","abbr":"WI"}, "WY":{"count":"50","name":"Wyoming","abbr":"WY"} }; [Generated using jQuery and the US Postal Service. ;) ]...

Cleinman Performance Partners has a new website

00:15 29 January in General by Thomas

Since my last post, which I know was some time ago, I've started a new position with a consulting firm in Upstate New York, near where I was born and raised.  When I left Upstate at the age of 18 for college, I knew I was going to be gone for a long time, but I also knew I was always going to come home.  Last year, the stars aligned, and I found a job very close to my hometown, where I could move home with my wife and 1 year old son, and give him the same life in the woods that I had growing up. This was no mean feat.  Finding a position as a developer away from an urban area is tricking, but I found Cleinman Performance Partners.  An optometrist consulting company, CPP helps medical professionals of that certain bend be more successful, and in fulfilling that task they decided to invest in me to give them an edge most companies don't have in house.  Their unique needs and drive led them to the conclusion that a mere webmaster, or web design company, wasn't enough. I've been here since September, and the challenges have been thrilling.  I have complete latitude to make all the technical determinations necessary to make this website a success, and I have been able to put out some of my finest work to date.  I hope this is a trend that continues for a long while. [caption id="attachment_63" align="aligncenter" width="400" caption="Cleinman Performance Partners"][/caption] The design is derived from what existed when I began...

HTML5: So much potential

09:00 20 July in HTML5 by Thomas

I've recently been tasked with researching HTML5 for my company.  The point of this is to generate very specific search pages for mobile devices, starting with the iPhone, iPod and iPad.  So far, thanks to the compliance level of the iOS version of Safari, its been great fun. Due to this, we now how CS5 in the office, because the new Dreamweaver has some nice improvements to make this a little easier.  As and aside, kudos to Adobe for their fine works on this version. Fortunatly for me, using HTML5 techniques on this project is going to turn out an excellent mobile search when I'm all done.  However, unfortunatly, it will be a while before I can carry ovr some of the things I'm learning here into other areas. HTML5 support in web browsers is currently spotty at best.  My best experience thus far testing new tags and attributes has been on Chrome, Safari and Opera.  I'm seeing among the daily user I encounter increasing usage of Chrome, but I know very few people who use Safari, and no one who uses Opera for general web surfing. (I'm not saying Opera is a bad browser by any means, just that its adoption rate is negligible in my personal observations.) The big browsers right now are Firefox and Internet Explorer.  Firefox is planning more support in the near future, which i guess is fine, but its IE that will be the bigger problem. Versions 7 and 8 are now widely being used by general users, and this is only because of...

General Update

07:41 21 April in General by Thomas

As busy as I am with work and fatherhood, I have a moment today where I thought I would give an update on my recent activities. Lately I've been doing more JavaScript, which has really broadened my mind.  My most recent work is this new contact page for Smarter Agent's MLS inquiries. Using JS and PHP, I built a dynamic form to send mail without loading a new window. [caption id="" align="aligncenter" width="400" caption="Smarter Agent MLS Contact Form"][/caption] JavasScript is used to validate  all of the form fields, with some form validation by PHP after the submit button is checked.  It took a good afternoon, and was lots of fun. I've been using JS to build new downloaders for Smarter Agent's Homes for Sale mobile application.  Recently I've been doing more downloaders for mobile devices, which require a broad set of considerations.  Given the variety of phones, and their differing capabilities, you can't  rely on one way of doing things.  The iPhone is a very capable device to design for, but obviously Flash is out of the question.  Android is also quite nice, but seems to lack JavaScript in application browser windows (meaning a browser window opened by an Android application.  The Android browser by itself is very capable.).  Palm is excellent as well, but older model Blackberry devices and not-so-smartphones require the most basic of codes. This week has been dedicated to more mobile oriented work than I normally do, but its been fun.  Hopefully in a few weeks time I will have every...

Smarter Agent has a new website

18:19 22 October in General by Thomas

This past Saturday we launched the new Smarter Agent website. Designed by Alison Hinch, with Flash by Nick 'the best damn intern' Mazzetti, constructed and implemented by me, it came online October 17th in all its glory. This is the second time I've rebuilt the site for Smarter Agent, and the first major redesign implementation. It was a good technological leap too, bringing several new functions for customers that should help us serve them better, and platform changes for further improvements in the near future. Its built with a new CMS system, with many custom sections for unique database requirements. I've been doing 'bolt tightening' on it all week, and am excited about the new work this is going to come next. [caption id="" align="aligncenter" width="500" caption="The new Smarter Agent site. Click to visit."][/caption] Credits: Alison Hinch Nick 'the best damn intern' Mazzetti...

JavaScript function for blacklisting characters in Unicode

17:18 18 August in Forms, General, JavaScript by Thomas

This is a handy little function I wrote today to help me out with a special text field. This field needs to accept number and letters only, no spaces and no other characters.  There is a var for each character I don't want the field to accept, and there is an array that holds all those vars for the checking loop at the end. Depending on how this field works out, I may need to restore a couple of characters, like '-' and '_', for which all I have to do is remove them from the array. My short hand for the characters may be a little vague, but you can find the Unicode for any character by using the Character Mapper in Windows. function noChars(e) { var keynum; var keychar; if(window.event) // IE { keynum = e.keyCode; } else if(e.which) // Netscape/Firefox/Opera { keynum = e.which; } keychar = String.fromCharCode(keynum); var space = /u0020/; var hash = /u0023/; var exc = /u0021/; var at = /u0040/; var dollar = /u0024/; var perc = /u0025/; var amp = /u0026/; var lper = /u0028/; var rper = /u0029/; var ast = /u002a/; var apos = /u0027/; var lbra = /u007b/; var pipe = /u007c/; var rbra = /u007d/; var cir = /u005e/; var hm = /u002d/; var us = /u005f/; var plus = /u002b/; var equal = /u003d/; var sqrl = /u005b/; var sqrr = /u005d/; var bakslash = /u005c/; var forslash = /u002f/; var dq = /u0022/; var colon = /u003a/; var semi = /u003b/; var ques = /u003f/; var per = /u002e/; var com = /u002c/; var ltag = /u003c/; var rtag = /u003e/; var tld = /u007e/; var acc = /u0060/; var charChecks = new Array(space,hash,exc,at,dollar,perc,amp,lper, rper,ast,apos,lbra,pipe,rbra,cir,hm,us,plus,equal,sqrl,sqrr,bakslash, forslash,dq,colon,semi,ques,per,com,ltag,rtag,tld,acc); var i; for (i=0; i < charChecks.length; i++)...

Knowing you made the right descision… Priceless

12:18 26 July in Hosting by Thomas

Before this site came online yesterday, I used to use another site, hosted at Godaddy. The service with them was fine for a long time, up until about the beginning of this year.  At a certain point, I couldn't load files half of the time.  I would get these random disconnects.  I'm not even sure they would qualify as timeouts, its like the line would just go dead, with no reason why from the server.  I thought it was my computer, or my ISP, but when it began to happen in the office as well as home, I knew the problem was on their end. I wrote a letter detailing the problem, and said to the effect 'don't tell me its my computer, because its not just my computer, but also my work machine, and don't tell me its my ISP, because I don't have the same ISP at work, don't tell me its the program, because I have tried in multiple programs, and don't tell me its my firewall, cause again, I've tried from behind different firewalls.' The letter I got back from them was along the lines of  'please check your setting in Dreamweaver and your firewall'...