Category Archives: Uncategorized

we have .serialize() we have .serializeArray() and we have .serializeObject()

When working on one of my apps, I needed to be able to serialize multiple forms and send them off to be processed via ajax call, however not in every situation there are the same number of forms.. they are dynamically created based on certain conditions (say multiple user create submission as an example). so what I needed was a method of serializing all the forms and accessing the data effectivly. I could have easilly done this in php but figured it would be ‘nicer’ if I could do it before sending it to the processing script. so I found this: http://stackoverflow.com/questions/1184624/serialize-form-to-json-with-jquery (I know, gotta love Stack OverFlow right?)

$.fn.serializeObject = function()
	{
	    var o = {};
	    var a = this.serializeArray();
	    $.each(a, function() {
	        if (o[this.name] !== undefined) {
	            if (!o[this.name].push) {
	                o[this.name] = [o[this.name]];
	            }
	            o[this.name].push(this.value || '');
	        } else {
	            o[this.name] = this.value || '';
	        }
	    });
	    return o;
	};

Editors of choice for php, xhtml, css, jquery, and mysql (a couple changes)

A little less than 3 months ago I outlined my editors of choice for my work and low and behold it didn’t take me 6 months to review that list! it actually only took me one heh. Back in May, I started looking at a few tools out there after hearing some great reviews from some fellow devs. I ended up substituting Coda and NetBeans with Transmit and TextMate.

TextMate

Everyone has always raved about TextMate but at first glance it didn’t look all that great… but then I discovered it’s real power. The way it handles Language Support Plug-ins. Bundles, as they called in TextMate, are extremely powerful! I am able to switch between auto-complete and syntax highlighting for languages on the fly with keyboard short cuts (I still haven’t figured out however, how to add a keyboard shortcut to access php bundle though..). but really the best part of it all is the ability to use and create keyboard shortcuts for virtually anything very easily and quickly.

Here’s an example of html keyboard short cuts and tag usage that I found on YouTube:

Now.. imagine this kind of power with not only HTML but also any language that you can find a bundle for. mind you, all these tags and shortcuts are fully editable and customizable, so if you need a new tag.. you can fairly easily add it.

Transmit

For a long time I felt that an FTP client on it’s own was not very useful to me (especially when I already had Coda which was an editor and ftp client in one), but Transmit has become my FTP application of choice because it is simply by far one of the best ftp/remote file management and file synchronization tools I have found. It gives me all the power of opening remote files with any of my editors and then saving them back to the server automatically that Coda gives me, as well as give me an effective method of synchronizing my local and remote files or transferring files from one server (development) to another (integration or production) as simply as drag and drop. Transmit also has (of course) permission control options for remote files and directories, which is something every FTP program either has, or should have.