Javascript Minifier
Posted by Jason | Posted in Uncategorized | Posted on 14-06-2009
0
Last week, I created a simple online tool for minifying Javascript snippets or entire Javascript files.
Last week, I created a simple online tool for minifying Javascript snippets or entire Javascript files.
I can’t help but realize that the new ads from Microsoft are totally useless, unconvincing, and uninformative. The basic message behind the three major ads are:
Microsoft, I’d like to help. I’m not a fan, personally, but I’d like to help. Your Operating System comes pre-installed on 90%+ computers. You DON’T NEED TO MARKET as aggresively as you are! Second, instead of trying to make everyone think you’re hip & cool, why don’t you actually focus on making better software and better user interfaces? I can give a million reasons why I’m a Mac user, but the one reason that I tell everyone, regardless of their level of expertise in computing, is “Everyday, I wake up my Mac, do what I need to do, and then put it back to sleep. It just works everytime, the same way it did all the times before, and it will continue to work exactly as it does until I replace it with a new model. I don’t have to worry about scanning for spyware, cleaning up the registry, etc. I never have to figure out why my computer is suddenly running slow. It just works, everytime.”
Do you find it a hassle to manage external images? One day all your images show up just fine, and the next you see the infamous red x in it’s place, signifying that the image is no longer available. Frustrating!
With this quick fix, you can say goodbye to that problem. With a quick javascript event function, you can easily replace broken images with a default image of your choosing without any crazy server-side file existence checks.
The way to accomplish this is to reset the img tags src attribute on the OnError event. This event is fired when an image cannot be loaded for whatever reason. Perfect time to replace the image with the default image!
Example:
<img src=”http://www.somedomain.com/someimage.jpg” onerror=’this.src=”/images/default.gif”‘ />
With this one JavaScript event function, you no longer have to worry about whether images will show up, and best of all, viewers of your site won’t think you are a slacker
As you may have noticed, I just recently upgraded to Wordpress 2.5! I’m currently in the process of porting over all previous posts/comments.
This sites main objectives are simple:
I invite everyone to comment, yell at me, disagree with me, and give me your perspective on the topics I choose to write about.
Enjoy!