Tuesday, November 20, 2007

jQuery and FireBug Rock

So I was going to write a test page to check out the re-branded ASP.NET AJAX framework.  Well, that didn't happen.

Instead, I downloaded the source code to Ajax.NET Professional, put in the fix, re-compiled, and went to work on my project.

All was well in my world, until I hit brick wall.  When I attempted to serialize a large DataTable down to the browser as part of an Ajax response, something went wrong.  I think the generated JavaScript code that is part of Ajax.NET Professional croaked.  Yikes!

Well, since my project is a mashup of a few JavaScript libraries, I thought that perhaps one of them conflicts with Ajax.NET Professional.  So then I wrote another test page, which disproved my theory.  Doh!

At this point, I gave up on Ajax.NET Professional.  I was an inch away from rolling my own JSON serializer.  The rules are pretty simple, after all.   But some Googling led me to Json.NET, which is a simple JSON serializer/deserializer.  Except it's got some issues, too.  So I wrote a custom DataTable serializer using the JsonWriter class instead.  To keep things simple, every column value gets serialized as a string for me, an this worked beautifully.

On the client-side, I use jQuery to perform the Ajax requests as well as some fancy UI manipulation.  I think this is an awesome JavaScript library.

And FireBug is definitely worth mentioning, too.  I just don't know how JavaScript developers (myself included) coped for so long without it anymore.

No comments: