Archive for the ‘webdev’ Category
July 29th, 2008
In the interest of following jQuery’s motto of “writing less and doing more,” let’s write a simple slideshow using jQuery, JavaScript and a bit of CSS.
For starters, our main goal should be keeping the markup as clean as possible: <div id="slideshow"> <img src="img/img1.jpg" alt="" class="active" /> <img src="img/img2.jpg" alt="" /> <img src="img/img3.jpg" alt="" /> </div> Now let’s use CSS to position the images on top of each other and bring the active image to the images on top of each other and bring the active image to the top level with z-index:
Tags: animation, CSS, front-end, javascript, jQuery, webdev
Posted in webdev | 227 Comments
July 10th, 2008
In a recent post, I wrote that developers should better optimize their JavaScript. Well, that’s easier said than done, so I’d like to get down to the nitty-gritty and talk specifically about optimizing jQuery. Please note that this is not about performance tuning of the jQuery library, rather it is about better engineering the code we use to interact with it. If you’re not a jQuery programmer, and you have no interest in joining the fad, don’t worry—most of the concepts here apply to JavaScript and general programming as well.
1. Beware of class-only selectors
A great part about using a JavaScript library like jQuery is its selectors. But before you use them all over the place, stop to think: what are the processing costs?
Basically, jQuery defines all the elements on a page as a huge JavaScript object, … Read more…
Tags: javascript, jQuery, object oriented, performance, webdev
Posted in webdev | 16 Comments
June 13th, 2008
Let it not be said that I never fall victim to a web fad: AJAX, jQuery, SEO‚ I was there with bells on. So when everyone started hating Flash and doing all web animation with HTML/Javascript, I jumped right on board. I thought it was just great! You didn’t have to lose any SEO, and most importantly you never had to open that awful Flash GUI.
But have you noticed? EVERYONE ELSE IS DOING IT! There’s just too much Javascript on the internet these days, and it is bringing many browsers to a halt. My MacBook is less than a year old (2.1GHz, 1GB mem) and Safari has been crashing frequently. In Firefox I can only have three or so tabs open before serious lag1. While I don’t have a super gaming computer, my computer is better than the average user’s, and I … Read more…
Tags: apple, flash, javascript, jQuery, open source, performance, SEO, web2.0, webdev
Posted in general web, SEO, webdev | 4 Comments
March 22nd, 2008
At first glance Mac OSX Leopard looks like Tiger with a new, sleeker skinning. A few new applications are available, and a few others are broken, but overall basically the same thing. That is, until you discover the Spaces command.
Spaces are great, they’re like the Expose flyout but taken up a level. With Spaces, you can arrange all the windows on your screen, all the clutter, into multiple, separate areas. Each of these areas functions like its own desktop, when you use the Expose flyout, only the windows in that Space are seen. And the best part is that you can set programs to open by default in certain spaces. I love this feature, since I am always working on such disparate things. Now my web development can be separate from my web design and … Read more…
Tags: apple, mac OSX, workflow
Posted in webdev
March 15th, 2008
I put a bit of jQuery on my site, animating the links in my art portfolio section. Check it out. I really like jQuery actually, it looks nice, and its a great way to liven up a site’s visuals without using Flash and losing all that SEO.
The problem is that jQuery, which is essentially JavaScript, is also not very SEO friendly. You can use it pretty much the same way as Flash, in limited quantities where you don’t care about searchability. However, when you want to make it SEO friendly, it operates pretty similarly to AJAX. Basically, you don’t want jQuery to be the only way you access any content. Any content that is accessed with jQuery also needs to have hard links, anchor tags with the href to make the search engines happy. These anchor … Read more…
Tags: AJAX, javascript, jQuery, SEO, web2.0, webdev
Posted in SEO, webdev | 9 Comments
March 13th, 2008
This WP plugin is kind of pointless, since you can modify text capitalization via the CSS text-transform property: lowercase, capitalize and uppercase are all options. more info
While doing some WordPress customization recently, I ran into a problem forcing lower case output for the month headers in my blog archives.
It seems like a simple task but it turns out the WordPress templating engine prevents you from returning any strings from functions while within a template. You can use all the PHP you want, and call any function you want, but the functions in the end work by echo’ing out a result, rather than returning it. This seems like a pretty good security move, but it turns out to be pretty annoying when you’re used to object oriented code and you want to do something simple like make an … Read more…
Tags: blog, customization, downloads, object oriented, open source, PHP, template, wordpress
Posted in webdev | 9 Comments
February 6th, 2008
Here's some free advice: don't forget the cache-control tags on any server-side AJAX page. I was doing some Geodesic Solutions customization today. Anyone who has dealt with Geo will tell you it's the biggest pain to customize, and that anyone who mentions Geo and best-practices in the same breath must be joking. Basically, the only way to customize it is through a series of patches, or by reworking the Geo class files (which will be overwritten in any upgrade). Geo doesn't allow any mysql calls within the templates (I suppose it's a good security measure), and since I didn't need to do too much database work, I decided to do all the database stuff with AJAX. So far so good. Basically, I was trying to populate a select box with a bunch of options, and I found out that IE … Read more…
Tags: AJAX, geodesic, server
Posted in webdev | 1 Comment
January 11th, 2008
I’ve been working on integrating an online shopping cart with in-house Quickbooks. I’m using SOAP (nuSOAP) and cURL / SSL to pass QBXML (Quickbooks XML) data through a port. Muchas gracias to Ryan Szrama of the open source project Ubercart for his extensive notes on Quickbooks / SOAP integration.I developed a pretty nice php class to pass data to the Quickbooks RDS server but the cURL requests kept failing, even though I opened the ports through the router and I had the computer they were passing data to on an FQDN DNS IP. It turns out I had to pass the IP through the server as well (SSH tunnel to: etc/hosts). It’s all good though, I would have liked to wrap up this project today, but it will have to wait for tomorrow.
Tags: integration, PHP, quickbooks, SOAP
Posted in webdev | 2 Comments
January 1st, 2008
It’s a new year, and what better way to start off than with a lengthy rant. Strap yourself in.
People often ask me why I am so concerned with writing standards compliant HTML, and they have good points, mainly that it takes longer to develop something that is compliant, and the only people who really know if it is are other developers. I’ve always been in favor of standards compliant code, but to be honest, for a long time I didn’t even know why I did it, it was really just nerd lore to me, the big nerds wanted it, and I agreed blindly. You might think that a production environment with constantly encroaching deadlines would make me throw my compliance to the wind, well to a certain extent it does (although I write standards compliant XHTML out of habit, I do not have time to fix other people’s … Read more…
Tags: CSS, web standards, WYSIWYG
Posted in webdev | 4 Comments
December 10th, 2007
AJAX isn’t typically thought of as being very search engine friendly. This is because search engines don’t process any JavaScript, which AJAX is built upon.
I’m using a ton of AJAX on this one search engine site. In fact, the search engine itself is done in AJAX since it makes for quick page loads and overall a great user experience. This is a big problem because we also, of course, want all the pages that our search engine indexes to be spidered by Google and the other search engines. Besides the AJAX search, the only other way users reach the bottom level pages is through an advanced search form, which of course Google can’t spider.The solution is to make a hard link search engine that parallels the AJAX one. Since the search begins with selecting a state, I put … Read more…
Tags: AJAX, PHP, SEO
Posted in SEO, webdev | 3 Comments