PHP Developer / Blog

Posts Tagged ‘javascript’

Keeping third party JavaScript from slowing down your site

Saturday, May 31st, 2008

All too many times I go to a blog or website and half of the page loads. Then it sits there waiting while a JavaScript file from another site loads. Some JavaScript cannot be placed at the bottom of the DOM because they use document.write(). It’s unrealistic to expect everyone to abandon third party sites (I use a script from Photagious for the photos on the right). But is there anything we can do to make them at least appear to load faster? (more…)

Extremely efficient image rollovers using CSS sprites and NO Javascript

Thursday, April 3rd, 2008

Recently we’ve seen the death of javascript rollovers. But rollovers aren’t such a bad thing. However, they generally required the use of multiple images and Javascript which would handle mouseover and mouseout events. I think this is why they lost their appeal. There’s got to be a better way, right? (more…)

When to embed your JavaScript

Saturday, March 29th, 2008

By now we should all know the benefits of including your JavaScript as external files. But does that mean we should always include them that way? The primary benefit of external JavaScript files is that the browser should cache them. So when someone comes to your home page and downloads yourfile.js it’s stored locally on the user’s computer. As they click through other pages on your site which include the same yourfile.js file then it’s pulled from cache. Subsequent page requests are sped up for two reasons. (more…)

Speed up Apache - how I went from F to A in YSlow

Wednesday, February 27th, 2008

I decided to embark on figuring out how to make my site as fast as possible. There were a few tips I was already aware of but decided to grade myself using YSlow. My initial score was bad, an F. I realized I had to do a few things.

  • Compress text/* files using gzip
  • Decrease HTTP requests by combining multiple JavaScript (and CSS) files into single files
  • Add aggressive caching since the site isn’t updated very often (especially images, JavaScript and CSS files)

Here’s what my original scores looked like. (more…)

Eliminate paging results by using JavaScript (ala DZone)

Monday, February 18th, 2008

I noticed that DZone had a really cool UI for a list of user submitted links. DZone is similar to Digg but geared more towards programmers. The premise is that a small subset of links are populated when the page loads. Once the user begins to scroll and nears the bottom of the list it automatically populates more stories to the end. This is a great alternative to having numerous pages that the user has to click through. You can also view a working example. (more…)

Solving “connection failure” for YUI’s asyncRequest

Friday, February 15th, 2008

Earlier today I was receiving a failure response when using YUI’s YAHOO.util.Connection.asyncRequest method to make an ajax call. The YUI documentation on this doesn’t help too much when troubleshooting the problem so we need to figure out what the heck is going on. (more…)

Closures - Demystifying Javascript’s secret weapon

Thursday, February 14th, 2008

Per Wikipedia, a closure is defined as “a function that is evaluated in an environment containing one or more bound variables“.

What’s a closure look like? (more…)


About this site:
This is my (Jaisen Mathai) personal site for potential employers who want to see my resume or portfolio. My ideal job would be to work as a PHP developer on a large scale consumer website. My experience is in using PHP, MySQL, Ajax and JSON. I really enjoy creative brainstorming...taking a problem apart and narrowing 100 solutions down to the best one.

Thanks for stopping by. Be sure to drop me a line.