Archive for the ‘JavaScript’ Category

Dev vs Dev! Java has a Library That Will do That

Tuesday, December 28th, 2010

What does a conversation between a new front end developer and a back end developer sound like? Using XtraNormal, I’ve created a video based on past experience. While this focuses on a Java developer, it is a compilation from ASP and PHP guys as well. If you’re a back end developer you should still see the humor in this. And if you don’t — then you resemble that remark!

If you’ve never seen an XtraNormal video, they don’t move a lot (my wife asked if they were going to fight). They are animated characters having a conversation. I think the humor comes out of the lack of emotion due to the computer generated voices.

Plain Text vs innerText vs textContent

Wednesday, September 1st, 2010

innerText and textContent are properties that get or set the text of an element or all its children. Internet Explorer implemented innerText in version 4.0, and it’s a useful, if misunderstood feature. WebKit also has innerText, carefully copying from, and even improving upon IE; and additionally has the standards compliant textContent, which we shall see, is no where near as useful and is in fact quite different. Firefox has textContent but not innerText, and a common mistake is writing code that retrieves one or the other, assuming the result will be the same (it’s not). Opera has the property, but it is little more than an alias of textContent, which to me is analogous to false advertising.

The Internet Explorer Five Step Recovery Program

Wednesday, June 30th, 2010

My name is Mike and I use Internet Explorer.

The IE9 Preview is looking strong, and Microsoft is bowing to the pressure of standards compliance. The IE9 Acid3 Test, which checks for CSS3 capabilities, is currently a very impressive score of 83; not very far behind Firefox’s 94. The release notes are a dream come true to anyone who’s done web development over the last ten years. Or is it too good to be true? If they didn’t include canvas in the next release it still might be years before we really have a full feature set of browser tools to work with, and canvas being arguably the most versatile, would be the most egregious omission. But the IE Team recently laid our fears to rest and updated their IE9 feature list to include canvas. Should we get excited? Or is this our abusive ex-boyfriend giving us a puppy? Before I’m able to seriously consider Internet Explorer as a viable platform, I may need professional help in order to get over the last decade…


Script Injection: Debug with Your Favorite AJAX Library

Tuesday, June 15th, 2010

You want to debug a web page using your favorite AJAX library, but it isn’t loaded into the page. Fortunately, there is a solution…

Script Injection: Debug with Your Favorite AJAX Library

Mock Data Randomizer

Wednesday, May 12th, 2010

A common step in the development cycle is to substitute fake data until real data is created, generated, or the API is set up to retrieve it. Creating this fake data isn’t usually difficult, but it can be a tedious and repetitive task. Club AJAX has added a new library item to create mock data for use in application development. Using the Club AJAX Randomizer, you can easily generate random numbers, booleans, colors, dates, characters, words, sentences, titles, names, and even website names. Helper functions are also available to scramble or return random elements from your own data.

Weighted Random Number

Monday, April 26th, 2010

If you are new to JavaScript, the method to get a random number may be difficult to grasp. The built-in function Math.random() does not accept any arguments, and it returns a decimal between 0 (inclusive) and 1 (exclusive). Most often, we want a whole number, maybe to be used for accessing a random element in an array. Consequently, random generators usually have to be custom coded. But what if we want to get a more weighted distribution of random numbers? Say of a random number between 1-5 we want 1 to show more often than 5? Even if you are not new to JavaScript, determining the math to add a weight to a random result can be quite tricky.


Fixing the JavaScript Console

Monday, April 19th, 2010

Firebug, the massively successful Firefox addon is an awesome development tool, but it’s not perfect. Carelessness in using it can lead to irritating and even embarrasing errors. And the console built into Internet Explorer 8? It’s great that web developers finally have something to help us develop on IE, but it is still pretty lame. When you consider working with both of them both together, you have even more problems. In general, it’s very undesirable to have debugging code cause bugs. Fortunately, there’s a very simple way of virtually eliminating these debugging errors.


JavaScript: Private Variables are Evil

Tuesday, April 6th, 2010

One of the more exciting discoveries in JavaScript programming was in 2001 when Douglas Crockford found the ability to create private variables in JavaScript. Granted, this was exciting, and as with any new toy, everybody started using them. Since then, you can’t find a book, tutorial or blog that doesn’t have some kind of “How to!!” showing how to do it. But, despite the excitement, private variables should be used in moderation at best.


Turns out JavaScript Really is a Toy

Thursday, April 1st, 2010

Bob and I have been studying JavaScript for years, we’ve started this website and user group, and we’ve even gone to conferences to evangelize the language. However, after doing the research for my RIA post, I’ve come to the realization…

JavaScript really is a toy.


Create modern Web sites using HTML5 and CSS3

Wednesday, March 31st, 2010

IBM developerWorks has posted one of the more in depth tutorials on getting you up to speed with HTML5 and CSS3.

New features in HTML5

New features in CSS3

And much more including examples and demos. Very thorough reference.