Tagged under ‘js’

My problem with JavaScript libraries

Published by patrick on 08 Apr 2009 01:18 -0700. 3 Comments. Tags:

I have a problem with JavaScript libraries. My problem is this: I feel that, in a way, they begin to replace actual JavaScript for new web developers. Let’s say I teach a person to use jQuery. I teach him to use the various functions, and how to use plugins. Then, I see him working on a project one day and see this code:

<script type="text/javascript">
$(function() {
$("#hide").hide();
$("#show").show();
}
</script>

That’s right, he’s importing 20kb of pure JavaScript awesomeness for… two lines of code that could have just as easily been done using raw JavaScript:...

continue reading...

Stop using JavaScript like it’s still the ’90s

Published by patrick on 08 Apr 2009 00:34 -0700. 2 Comments. Tags:

Sometimes, when I browse the internet, I get the feeling that some people still think it’s the late ’90s or early ’00s. I often come across new websites still using ugly markup and table-based layouts instead of CSS-based layouts.

Then there are those times that I find a site that, for some reason, finds it necessary to prevent me from right-clicking. When I come across one of those, I simply disable JavaScript for the remainder of the time I spend on the site. Of course, if the site also finds it also necessary to pop up a little box that ...

continue reading...

Article: GZip files with .htaccess and PHP

Published by patrick on 20 Dec 2008 23:44 -0800. 0 Comments. Tags:

I have written an article at Lateral Code entitled GZip files with .htaccess and PHP.

Many hosts have a set bandwidth clients can use. In this day and age, files are getting larger and heavier, but bandwidth costs aren’t getting much cheaper. So, one of the best and easiest things to do is to GZip.

From “The Definitive Post on GZipping your CSS”

CSS files for larger sites can become pretty large themselves. Gzipping or compressing these files has shown to provide a reduction in the neighborhood of 70-80% of the original file size, a fairly significant ‘weight loss’.

So obviously, GZipping CSS is great. But what about JS? JavaScript files are becoming increasingly huge, so what should we do about that?…

continue reading...
 1
Top ↑