Rey Bango

JavaScript, HTML, CSS & Random Stuff…

jQuery JavaScript Templates Tutorial: Nesting Templates

In my last post, I presented an intro to how to create a template using the new jQuery Template plugin being developed by the Microsoft Ajax Core team. In this tutorial, I’ll show you how to nest templates to have great control over your layout.

The nesting of a template within another template is a pretty valuable feature as it lets you create a modular structure for your layout. Instead of having to create one enormous template to cover every scenario, you can break the layout apart into individual templates and piece them together. Let’s start by defining some data:

       var clientData = [
	        { name: "Rey Bango", age: 42, id: 1, phone: [ "954-600-1234", "954-355-5555" ] },
	        { name: "Mark Goldberg", age: 51, id: 2, phone: ["954-600-1234", "954-355-5555"] },
	        { name: "Jen Statford", age: "25", id: 3, phone: ["954-600-1234", "954-355-5555"] }
        ];

What I’d like to do is to render the basic information like the name and age in one template and then render the phone numbers for each client in a different template.

Like I showed in my previous post, we first create a template for our layout:

<script id="clientTemplate" type="text/html">
	<p><a href="clients/${id}">${name} - Age: ${age}</a></p>
</script>

This will display the name and age as a hyperlink included within paragraph tags. Next, we create a new template that will be used to render the phone numbers for each client”

<script id="phoneTemplate" type="text/html">
	<ul>{{each phone}}<li>${$value}</li>{{/each}}</ul>
</script>

Lastly, we’re going to include the call to “phoneTemplate” in our main template using the “tmpl” tag. This tag is used by the plugin to identify templates and parse them accordingly. Here’s what the call would look like:

{{tmpl($data) "#phoneTemplate"}}

and we’re going to include it into the main template:

<script id="clientTemplate" type="text/html">
	<p><a href="clients/${id}">${name} - Age: ${age}</a></p>
	{{tmpl($data) "#phoneTemplate"}}
</script>

This will generate the following results:

There are a couple of key things to understand here. First, let’s look at the following:

{{tmpl($data) "#phoneTemplate"}}

The variable “$data” contains the data for the current record being parsed. We’re passing it to the nested template so that we can work with that record. Let’s move onto the nested template:

<script id="phoneTemplate" type="text/html">
	<ul>{{each phone}}<li>${$value}</li>{{/each}}</ul>
</script>

Now that the current record has been passed to it, we can access the attribute name, in this case “phone”, and loop through each phone record using the ‘{{each}}‘ plugin template tag. Think of it as similar to jQuery’s $.each() method or a JavaScript “for” loop. The code will loop through each phone record creating a new list item for each one and then return to the main template to get the next main record.

Here’s the whole code for you to work with:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="robots" content="noindex" />
  <title>Template Test</title>
  <script src="http://code.jquery.com/jquery.min.js" type="text/javascript"></script>
  <script src="jquery.tmpl.js" type="text/javascript"></script>
  <script type="text/javascript">
  $(document).ready(function() {

        var clientData = [
	        { name: "Rey Bango", age: 42, id: 1, phone: [ "954-600-1234", "954-355-5555" ] },
	        { name: "Mark Goldberg", age: 51, id: 2, phone: ["617-777-1234", "617-222-3333"] },
	        { name: "Jen Statford", age: "25", id: 3, phone: ["608-555-5647", "608-645-8855"] }
        ];

        $("#clientTemplate").tmpl(clientData).appendTo("div");

});
  </script>

<script id="clientTemplate" type="text/html">
	<p><a href="clients/${id}">${name} - Age: ${age}</a></p>
	{{tmpl($data) "#phoneTemplate"}}
</script>

<script id="phoneTemplate" type="text/html">
	<ul>{{each phone}}<li>${$value}</li>{{/each}}</ul>
</script>

</head> 

<body> 

<div></div>

</body>
</html>

Not Using jQuery JavaScript Templates? You’re Really Missing Out.

In preparation for my upcoming talk on jQuery Templates, I’ve been been deep diving into the jQuery Template plugin created by Microsoft.. Many of you are probably familiar with server-side template engines like Smarty or Cheetah but only recently have client-side template engines taken off. Considering how complex our web apps are becoming, it makes total sense.

The cool thing about templates is that it lets you easily structure your content display without all the hassle of string concatenation. For example, say I had a data set containing an ID and a name and I wanted to display the name as a hyperlink.

I could do something like this:

var clRec = "";

for(var i=0; i<client.name.length; i++) {
    clRec += "<li><a href='clients/"+client.id[i]+"'>" + client.name[i] + "</a></li>";
}

but to me, this seems much more readable and maintainable:

<li><a href="clients/${id}">${name}</a></li>

The second code snippet is a template I’ve created to render a hyperlinked name in a list and it’s very easy to do. First, include both jQuery and the jQuery Template plugin into your page:

<script src="http://code.jquery.com/jquery.min.js" type="text/javascript"></script>
<script src="jquery.tmpl.js" type="text/javascript"></script>

Next, define the data that you’d like to see rendered. This could be data derived from an XHR call or something you’ve predefined, like this:

	var clientData = [
		{ name: "Rey Bango", id: 1 },
		{ name: "Mark Goldberg", id: 2 },
		{ name: "Jen Statford", id: 3 }
	];

Now, define your template:

<script id="clientTemplate" type="text/html">
	<li><a href="clients/${id}">${name}</a></li>
</script>

Yep, the “script” tags are necessary and used because they allow your template to be embedded within the body of the page. Notice that we’ve defined the placeholders as ${id} & ${name}, the same names used in the identifiers in our data. The “${}” tells the template parser that the field needs to be replaced with the expected value.

Then call the jQuery Template plugin to render the data using your template:

$("#clientTemplate").tmpl(clientData).appendTo( "ul" );

The plugin’s .tmpl() method accepts the data we’ve defined and handles the parsing of the template we’ve selected. Then we use jQuery’s .appendTo() method to append the results to an unordered list tag. This gives me the following results:

That’s it! Told you it was simple. :)

I’ll go into more advanced details during my presentation but this should give you something to start with in the meantime. Here’s the full source for you to use:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="robots" content="noindex" />
  <title>Template Test</title>
  <script src="http://code.jquery.com/jquery.min.js" type="text/javascript"></script>
  <script src="jquery.tmpl.js" type="text/javascript"></script>
  <script type="text/javascript">
  $(document).ready(function() {

	var clientData = [
		{ name: "Rey Bango", id: 1 },
		{ name: "Mark Goldberg", id: 2 },
		{ name: "Jen Statford", id: 3 }
	];

$("#clientTemplate").tmpl(clientData).appendTo( "ul" );

});
  </script>

 <script id="clientTemplate" type="text/html">
	<li><a href="clients/${id}">${name}</a></li>
</script>

</head> 

<body> 

<ul></ul>

</body>
</html>

I’m Presenting on jQuery Templates at ThinkVitamin’s jQuery Online Conference

This coming Monday (7/12/2010), I’ll be one of the speakers at Think Vitamin’s jQuery Online Conference. I’ll be speaking about using the Microsoft jQuery Template plugin to produce easily maintainable dynamic pages via pre-built JavaScript templates. This is a great topic and it looks like the event is generating a lot of registrations. Very cool.

I’ll be joined by three other awesome speakers including John Resig, Karl Swedberg and Ben Alman. Here’s the breakdown of the sessions:

Topics and schedule

  • Beyond String Concatenation. Using jQuery Templating to Cleanly Display Your Data
    Rey Bango

    In this presentation, Rey will show you a new way to produce easily maintainable dynamic pages via pre-built JavaScript templates and the Microsoft jQuery templating plugin.
  • Testing Your Mobile Web Apps
    John Resig

    This talk will be a comprehensive look at what you need to know to properly test your web applications on mobile devices, based upon the work that’s been done by the jQuery team. We’ll look at the different mobile phones that exist, what browsers they run, and what you can do to support them. Additionally we’ll examine some of the testing tools that can be used to make the whole process much easier.
  • Taking jQuery Effects to the Next Level
    Karl Swedberg

    One of the first things web developers learn to do with jQuery is to show and hide elements on a page and then add some flair by sliding those elements up and down or fading them in and out. Too often, though, we stop there, missing out on the incredible range and flexibility of jQuery’s core effects. In this talk, we’ll investigate both standard and custom animations and how they can be used to create useful and fun effects. We’ll also build a couple effects plugins, explore parts of the effects API that are often overlooked, and learn how to avoid common problems when attaching these effects to certain events.
  • jQuery Pluginization
    Ben Alman

    In this live-coding session, Ben explains how, with just a little thought and effort around generalization, parameterization and organization, you can convert your “just get the job done” jQuery code into a legitimate, reusable, modular jQuery plugin.

This really is a great lineup and I’m looking forward to being a part of this great event. It’s been a very long time since I’ve done a presentation so this will be a good warm up for some other conferences I plan on speaking at later this year.

Be sure to use the following discount code for a 15% discount on registration: jquery15

Generic Activity Indicator for Ajax Requests

Over the weekend I was fiddling was some code to see how to make a generic activity indicator for Ajax requests. I’m sure most of you have seen these but if not, here’s one similar to what Facebook uses:

While it’s may not look like much, that animated .gif is pretty important because it tells a user that something is happening and that results will appear shortly. The last thing you want is for a user to think the page has locked up or broken and using this simple method advises them that their request is being processed.

Targeted Indicators

In my case, I was looking for a way to set an indicator within the specific DOM element that would be affected by the XHR call. So if my XHR call was to set the contents of a specific DIV, I wanted the indicator to render within that specific DIV only (similar to what Facebook does).

First, I created three DIVs and 3 anchor tags:

<a href="#">Box 1</a>|<a href="#">Box 2</a>|<a href="#">Box 3</a> 

<br /><br />

<div id="box1">&nbsp;</div>
<div id="box2">&nbsp;</div>
<div id="box3">&nbsp;</div>

and I set the DIVs to a specific width and floated them left:

#box1, #box2, #box3 { background-color:#E5EECC; border:1px solid #D4D4D4; width: 200px; float:left; };

Next, I created a new method called fillBox() that would take the target element’s ID and use that to dynamically create a new IMG tag and insert the activity indicator. What I decided to do was leverage jQuery’s global Ajax events to create the generic handlers for this. Using ajaxStart(), which fires off when an Ajax request is initiated, I dynamically create the tag for my activity indicator and inset it using the prepend() method:

		$(ele).ajaxStart( function() {

			$(this).prepend( "<img id='throbber' src='facebook.gif' />" );

		})

Then using the Ajax global event handler ajaxStop(), I would easily delete the indicator once the Ajax request was done by using the remove() method to delete the IMG tag from the DOM:

ajaxStop( function() {

	$("#throbber").remove();

});

Lastly, using some event delegation, I created an event handler for the clicks on the anchor tags:

$( "a" ).click( function(e) {

	var el = '';
	switch(e.target.text) {
		case "Box 1":
			el = '#box1';
			break;
		case "Box 2":
			el = '#box2';
			break;
		case "Box 3":
			el = '#box3';
			break;
	} 

	fillBox( el );

});

The handler simply looked for the anchor tag’s text and based on that filled a local var with the ID that would be targeted for the indicator. It then passed that ID to the fillBox() method.

A Little Roadblock

I thought I was done and the code look pretty straightforward. When I ran this, though, I experienced some odd behavior:

When I would click on the “Box 1″ link, the indicator would correctly appear in the first DIV followed by the data populating the box. When I would next click on the “Box 3″ link, though, both the first box AND the third box would have the indicators displayed! Not good.

I looked into it and got feedback from Adam Sontag who provided the answer I needed. I had incorrectly assumed that ajaxStop() would unbind the jQuery global Ajax events from the attached element. Unfortunately it doesn’t so by using the unbind() method, I was able to resolve the issue.

		$.ajax({
		  url: 'test.php',
		  cache: false,
		  success: function(data) {

			$(ele).html( data ).unbind( 'ajaxStart' ).unbind( 'ajaxStop' );

		  }
		});

	};

The Solution Gets Easier

Then I got more feedback from Karl Swedberg which really streamlined the whole thing. He recommended forgoing the Ajax global events altogether and simply inserting the indicator via my fillBox() method directly and since I was replacing the contents of the DIVs with the html() method, there was no need to use remove() since the IMG tag was already being removed.

var fillBox = function( ele ) {

	$(ele).prepend( "<img id='throbber' src='facebook.gif' />" );

	$.ajax({
		url: 'test.php',
		cache: false,
		success: function(data) {

			$(ele).html( data );

		}
	});

};

So while I initially was looking to use jQuery’s built-in global Ajax event handlers for making this generic, I’m finding Karl’s solution much cleaner. It requires less event handlers and method calls to do the same task. Love it!

Here’s the end result and you can see the demo here:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="robots" content="noindex" />
  <title>Throbber Test</title>
  <style>
	#box1, #box2, #box3 { background-color:#E5EECC; border:1px solid #D4D4D4; width: 200px; float:left; };
  </style>
  <script src="http://code.jquery.com/jquery.min.js" type="text/javascript"></script>
  <script type="text/javascript">

	fillBox = function( ele ) {

		$(ele).prepend( "<img id='throbber' src='facebook.gif' />" );

		$.ajax({
			url: 'test.php',
			cache: false,
			success: function(data) {

				$(ele).html( data );

			}
		});

	};

	$(document).ready( function() {

		$( "a" ).click( function(e) {

			var el = '';
			switch(e.target.text) {
				case "Box 1":
					el = '#box1';
					break;
				case "Box 2":
					el = '#box2';
					break;
				case "Box 3":
					el = '#box3';
					break;
			} 

			fillBox( el );

		});

	});
  </script>

</head> 

<body> 

<a href="#">Box 1</a>|<a href="#">Box 2</a>|<a href="#">Box 3</a> 

<br /><br />

<div id="box1">&nbsp;</div>
<div id="box2">&nbsp;</div>
<div id="box3">&nbsp;</div>

</body>
</html>

Canvas Baby Steps: An Introduction to the HTML 5 Canvas Element

I hate to admit it but I haven’t looked at <canvas> yet. It’s not for lack of wanting but more of time. Seems like there’s SO many cool things out there to learn and nailing down time is tough. So I decided to dip my toe into.

For those not familiar with it, the HTML 5 <canvas> element provides a rectangular area where you can draw anything you want on. It’s pretty slick and seems pretty powerful. In essence, instead of solely relying on image creation tools like Photoshop, GIMP or Paint.net for generating graphics, you now have a native element on which to do it.

If we look at the <canvas> element, the format is just like any other HTML element:

<canvas id="can1" width="300" height="300"></canvas>

You define the element along with specific attributes, just like most any other HTML element. In this case, we’re assigning it an “id” along with the width and height of the rectangular drawing area. The reason we assign it an “id” is to allow us to later reference the element via JavaScript and call the methods necessary to start drawing.

Now, I’m by no means a Picasso, which is why I tend to focus more on programming than design work. I prefer to leave that to the pros with a real creative knack but I will at least attempt to create something colorful.

The first thing we need to do is great a reference to the <canvas> element. Remember that I discussed adding an “id” attribute to the element? This is where it comes in handy:

var myCanvas = document.getElementById( "can1" );

You could do the same thing in jQuery this way:

var myCanvas = $( "#can1" )[0];

but because we really don’t need all of the jQuery library’s syntactic sugar for this small demo, I’m just going to use plain ‘ole JavaScript.

Next, we’ll use the element’s getContext() method to grab the rendering context for that element. This is the area within your <canvas> element where the actual drawing will occur. It doesn’t have to be the same size as your canvas but it needs to fit within it.

var myContext = myCanvas.getContext( "2d" );

We specify “2d” as a parameter because it’s the only rendering context currently supported by the specification so for now, you’re limited to flat drawings.

Now that I have the rendering context, I can begin making my drawing. Using the fillStyle and strokeStyle properties, I can set the fill color for specific areas of my drawing and the color of the borders respectively. Then using the strokeRect() & fillRect() methods, I can use the colors defined in those properties to effect the change:

  myContext.fillStyle   = '#00f';
  myContext.strokeStyle = '#f00';
  myContext.lineWidth   = 4;
  myContext.strokeRect( 0,0,300,300);
  myContext.fillRect(0, 0, 300, 300);

What this does is gives me a nice blue box with a red border around it. It may not look like much but the fact that we’re able to do this via HTML and JavaScript is pretty cool:

Now I want to get fancy (well as much as I guess I can). I want to create a shape within the canvas rendering context so I’m first going to use the moveTo() method to position my starting point. The two parameters are “x,y” coordinates within your rendering context and I’d like to start at the top and centered:

  myContext.moveTo( 150, 0 );

Next, I’ll use the lineTo() method to draw a line to different “x,y” coordinates. Notice that I don’t have to re-use the moveTo() method to reposition the starting point of each line.

  myContext.lineTo( 0, 150 );
  myContext.lineTo( 150, 300 );
  myContext.lineTo( 300, 150 );
  myContext.lineTo( 150, 0 );

This code renders a box like this:

The last things I want to do are to adjust the fillStyle and strokeStyle properties so that they’re a different color:

  myContext.fillStyle   = '#F63806';
  myContext.strokeStyle = "#000";

and then using the fill() and stroke() methods, apply the color changes to the new drawing:

  myContext.fill();
  myContext.stroke();

Wooo!! Okay, okay this is not going to land me a million bucks at an auction or even $1.50 on Esty but it’s a start. While what I built is fairly simple, the power of <canvas> can really be seen by visiting Canvasdemos.com. Along with excellent demos built using <canvas>, it provides tutorials on how to get up to speed on this element.

One really cool thing is that the gaming industry is keenly looking at <canvas> since it will help them distribute new games without the need for special plugins. Here’s a tutorial, for example, that talks about how to create a game using <canvas>. It certainly won’t replace dedicated console or PC games but it does open up opportunities to build the next FarmVille or PacMan. :)

Here’s the code to my tutorial:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="robots" content="noindex" />
  <title>Canvas Test</title>
</head> 

<body> 

<canvas id="can1" width="300" height="300"></canvas>

  <script type="text/javascript">
  var myCanvas = document.getElementById( "can1" );
  var myContext = myCanvas.getContext( "2d" );
  myContext.fillStyle   = '#00f';
  myContext.strokeStyle = '#F63806';
  myContext.lineWidth   = 4;
  myContext.fillRect(0, 0, 300, 300);
  myContext.strokeRect( 0,0,300,300);

  myContext.moveTo( 150, 0 );
  myContext.lineTo( 0, 150 );
  myContext.lineTo( 150, 300 );
  myContext.lineTo( 300, 150 );
  myContext.lineTo( 150, 0 );      

  myContext.fillStyle   = '#F63806';
  myContext.strokeStyle = "#000";

  myContext.fill();
  myContext.stroke();

  </script>

</body>
</html>

jQuery Fundamentals Training Material Available as Open Source

In an incredibly generous move, jQuery star Rebecca Murphey has released the training materials she uses for her jQuery Fundamentals class under the Creative Commons Attribution-Share Alike 3.0 United States license. This is a pretty significant contribution because developing good training material is very difficult and if you’re looking to help get your staff or friends up to speed on jQuery, this is a great foundation to build from. In fact, she seems to encourage it! Check this out:

You are free to copy, distribute, transmit, and remix this work, provided you attribute the work to Rebecca Murphey as the original author and reference the GitHub repository for the work. If you alter, transform, or build upon this work, you may distribute the resulting work only under the same, similar or a compatible license. Any of the above conditions can be waived if you get permission from the copyright holder. For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to the license.

Seriously, that’s a lot of flexibility and she’s even set it up in a nicely package Github repo for easy access. I looked it over and this does a great job of covering the basics of jQuery.

If you use her materials, definitely give her, at the very least, a shout-out during your training. She deserves it.

I’m going to add this to my list of awesome web development resources since this is golden.

Thanks for the putting this out there, Rebecca!

Shrinking Your JavaScript Files for Improved Page Performance

With all of the performance advances in JavaScript engines in modern browsers, it’s easy to forget that we still need to do some legwork ourselves, especially considering how many users are still on older browsers. Compressing JavaScript files is an oft forgotten task which could have a dramatic & positive impact and something that will make our apps perform better (as well as make Steve Souders, Kyle Simpson & Nicholas Zakas very happy). :)

I used to use the YUI Compressor but based on John Resig’s findings during the release of jQuery 1.4, I’ve switched to using Google’s Closure Compiler which seems to get better compression.

Setting Things Up

It’s incredibly easy to compress files and I’m going to outline the steps. The first thing you need to do is download Java. Since the Closure Compiler comes in the form of a .jar binary file, you’ll need Java to run it. Also, I’d recommended ensuring that you make Java available via your OS path so that you don’t need some long, convoluted command line statement to get to it.

Next, download the Closure Compiler .jar file and drop it into a convenient place that’s easily accessible.

For this tutorial, I’m going to use the uncompressed version of jQuery since it’s sizeable and will be a good sample to use to demonstrate the results. Uncompressed, that file comes in at 161kb. Note, though, that jQuery already comes packaged in a compressed, ready-to-use form via the jQuery website and I’m only using the file for demonstrating file compression.

Compressing the Code

Actually compressing the code is incredibly easy. Note that I’m using Windows so the steps will differ a little if you’re using OSX with terminal.

Go ahead and click on Start->Run and open a command prompt window by typing in “CMD” and hitting Enter. From there, change directories to the directory where you’ve saved your uncompressed jQuery JavaScript file. If you can’t remember the DOS command for it, look up “CD” which is the command to allow you to change directories. For example, I need to enter the following to go to my directory:

cd \rey\closure

Next, run the following command to run the Closure Compiler:

java -jar compiler.jar –js=jquery-1.4.2.js –js_output_file=jquery-1.4.2-compressed.js

This will run the compiler and create a new, compressed version of the .js file. The results are immediately obvious:

jQuery Uncompressed: 161kb
jQuery Compresse: 71kb

Shaving off more than 50% of the file size is a REALLY big savings when your users initially come to the site and you want them to get snappy pages.

Other Choices

I would highly encourage you to check out the other compressors available to determine which one works for you. In a recent post I made outlining a list of tools I think are really important to client-side development, I mentioned the following:

YUI compressor
JSMIN
Dean Edward’s Packer
Microsoft Ajax Minifer
Dojo Shrinksafe

For example, when I ran those tools on the same uncompressed jQuery file, here’s what I got:

YUI Compressor: 78kb
Microsoft’s Ajax Minifier: 72kb
Dojo Shrinksafe: 86kb

I tried using Packer and an online version of JSMin but I think the size of the file caused them both to timeout so I don’t have figures for you.

Again, it’s important that you do your own homework as there may settings that I’m not leveraging and could offer even better compression. If you find better performance, let me know. I’d love to hear about it.

TXJS JavaScript Conference Wrapup

Last Saturday I attended TXJS, my second conference of the year focused specifically on JavaScript-related discussions and presentations. The conference drew approximately 180 attendees consisting of some of the most well-known JavaScript developers in the world including Douglas Crockford (JavaScript luminary), Pete Higgins (Dojo Project Lead), John Resig (creator of jQuery), Andrew Dupont (lead developer of Prototype), and more.

Sessions

The conference was a bit different from JSConf, which I attended in April, in that it clearly was focusing more on client-side development versus server-side JavaScript implementations such as Node or Narwhal. The discussions, though, were similar in targeting the intermediate to advanced developer levels which demonstrates a maturing of the JavaScript developer community. Sessions were given by well-known developers such as Douglas Crockford (Yahoo!), Brian Leroux (Nitobi & mobile expert), John Resig (creator of jQuery) and Pete Higgins (Dojo team lead), to name a few.

While I attended several sessions, including some dealing cross-domain communication and Facebook’s abstraction layers, one sidebar impromptu session interested me the most because it really wasn’t supposed to be a session. A developer from the Selenium project asked John Resig, Pete Higgins and Ed Spencer (lead developer for Ext JS) to sit with him to discuss application testing. That turned into a full-on panel discussion about the topic attended by ~30 people. The feedback:

  • It was said that Selenium was not a great testing tool but it’s the only choice we have
  • Selenium’s lack of intimate knowledge of the major frameworks is a hindrance in spite of the fact that these libs are just JavaScript
  • Mobile is severely lacking adequate testing tools forcing developers to purchase expensive handsets to verify functionality

I also heard that John Resig’s presentation, “JavaScript on the Mobile Web”, was outstanding. John has been doing a tremendous amount of mobile testing, specifically to be able to build jQuery for Mobile and has documented quite a bit of information on the various mobile browsers and their support of JavaScript and the DOM.

Microsoft

Now that I’m working at Microsoft, I much more aware of what’s being said about the company because I want to be able to report on the good and fix the bad.

Some of the Good Points:

  • We sponsored the shuttle bus which was prominently mentioned during the keynote and heavily used by attendees for going to the event as well as returning to the sponsor hotel. It seemed that the shuttle bus really helped the attendees and I’m glad we handled that.
  • I spoke to a number of attendees who were both surprised and impressed by Microsoft’s expanded efforts to address client-side developers. Our announcements around IE9 relating to HTML5, CSS3 & related specs has also been a boon with VERY positive feedback about our direction. Developers are genuinely excited about this but are anxious for more information and transparency. Having IE PM Carter Rabasa attend TXJS was invaluable. He was able to vet questions for developers as well as offer feedback about HTML5 and CSS3.
  • The “IE6 Must Die” mantra was nowhere near the level that was displayed during JSConf. Feedback from several developers was much more empathetic with many simply saying that supporting IE6 is “part of our responsibility as web developers”. It’s not to say that anyone has to like the current state of affairs and I know I would like IE6 to go away (as would Microsoft) so we can leverage the cool new stuff but when you look at feedback from Tom Ochinno of Facebook where he clearly said that dropping IE6 would affect 5M+ users, that puts a very different spin on what we unfortunately need to support.
  • Douglas Crockford attended Jeffrey’s session and expressed how much he loves Reactive Extensions for JavaScript. This made me very happy for my friends Jeffrey Van Gogh and Matthew Podwysocki, who have worked so hard on this.

Some of the Bad Points:

  • Developers want more information on IE9 and that’s not something I could offer at this time. Always tough.
  • Developers want IE6 to go away (so do we!) and that’s not something I could offer either. I think we need to focus on outlining, in a central place, all of the things that would make supporting IE6 much easier instead of developers learning by the school of hard knocks.

By the way, mentioning Facebook, Haste, Primer & Boot Loader rock. Can you make that publicly available?! Please?! :D

Friends

One of the great parts of a conference is the opportunity to see old friends and make new ones. I was very happy to see so many people that I only get to share virtual time with like Pete Higgins, John Resig, Brian Leroux, Jeffrey Van Gogh and a ton others. It was also amazing to meet people who I consider so incredibly talented and never thought I’d have a chance to hang with them like Dan Webb and Nicole Sullivan. Too cool.

To Kyle Simpson, thanks for spending some time talking with me at the hotel on Friday night. What a great conversation. I got see a different side of you man.

But most of all I really must thank Rebecca Murphey. Apart from putting on a great show, she truly is a wonderful person. Thanks for everything Rebecca and I will convince you South Florida is the next place to tackle. :)

Conference Feedback:

“briangarcia: Some random thoughts on the fantastic #TXJS . Anyone else think the event should be twice a year? http://bit.ly/dfv069”
“dcoder: Inspired by @joemccan’s #txjs talk; putting together a preso on wireframing and prototyping techniques and LoD. Now to find venues…”
“malsup: Major props to Rebecca and the yayCrew. #txjs was a first class event.”
“rogerpence: #txjs Was very cool. Crockford way cool and Resig so wise beyond his years! Other spkrs great, too. Great day! Job well done by all.”
“dstorey: Getting ready to take the Microsoft bus t @txjs. Hopefully it has hardware acceleration, but I’m not sure about the multiple engines.”

Pics from the Conference:
Courtesy Rebecca Murphey




Internet Explorer 9 Will Support the Open Source VP8 Video Codec

I was watching the Google I/O keynote and was floored by their announcement to release the VP8 codec as royalty-free open-source software. That’s a huge development especially from a huge player like Google. They’ve garnered support from Mozilla & Opera and they’re even discussing converting the whole YouTube archive to the new codec so this is a VERY big deal.

I just found out the Internet Explorer 9 will also support the VP8 codec on machines that have the codec installed. This is equally exciting as it expands IE9′s HTML video support to be consistent with that of other major browser vendors supporting playback of H.264 video as well as VP8 when the VP8 codec has been installed on Windows.

You can read more about the details in the official announcement.

Video Interviews – The YayQuery Crew and Paul Irish of the jQuery Team

Nailing down the crazy YayQuery crew and keeping them in one place was a challenge but Ralph Whitbeck and I managed to do it and nail down another jQuery Podcast/video interview in the process. Check them out:

Paul Irish is a crazy dude but also incredibly involved in jQuery and web standards development. He’s one of the newest members of the jQuery team and I sat down to chat with him:

THE BIG LIST!

My BIG LIST of JavaScript, CSS & HTML Development Tools, Libraries, Projects, and Books.

Constantly updated with the latest and greatest tools. Check it out!

Contact Me

AIM: iamreybango
GTalk: reybango at gmail dot com
GMail: reybango at gmail dot com
Twitter: @reybango


Twitter

Rey Bango is Digg proof thanks to caching by WP Super Cache