Tech Blog

Jay's Technical blog

JavaScript API's and Debugging

22 February 2007
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

As stated a few posts back, I spent some time looking at other Ajax frameworks. I really have become fascinated with the JavaScipt APIs. I know it's cool to not have to do JavaScript (JS, hereafter), but enabling a good JS API within a framework like ASP.NET or in Java's JSP/Servlet Architecture is really not that hard.

As I said, I'm fascinated with the libraries (I'm not always thrilled with where things are going)... As I have repeatedly stated I'm not so sure what I think of the Ajax/Web 2.0's improved GUI features (I think it's asking for trouble).

That said, one of the biggest pain points for me with JS is that traditionally you did 1 of 2 things while debugging.

1) Put alert calls all through your code to notify you of the values of your clientscript values
2) Create a Div and push data to the Div.

The latter being a bit of a pain to set up because you can't just use it. The latter choice is actually the better choice when throwing an alert up screws up your code.

With the emergence of tools like Mozilla's FireBug, this is getting easier, but it's still sometimes a pain.

Anyway, as I was digging around in the MS Ajax ClientScript API, I discovered the very cool Sys.Debug class. This basically lets me write trace information as well as dump for objects to JSON-like strings (using Sys.Debug.traceDump)) so I can see the values. These messages will show up in Visual Studio if you are debugging with IE; In Mozilla and Safari, this information gets written directly to the Debug console. They also let you create a textarea named "TraceConsole" which will display on the screen these messages (so it's not limited to debugging in only Mozilla and Safari).

Sys.Debug also has includes assertion statements which is nice.

Anyway, since I was discovering this nice facility I started to wonder if other JS frameworks have anything like this (the trace functionality... not the assert functionality).

I won't single out any particular framework (OK, I will single out 1), but will give you the list of JS Frameworks that I found that have some kind of debugging facilities.

The good
  • Ms Ajax (but you knew that)
  • Yahoo's YUI library has a complete logging facility and while I didn't find an equivalent of traceDump (but I'm sure it has a function for convert object to JSON string), the logging facility is much more sophisticated then what is in MS Ajax.
  • dojo has functionality almost identical to that found in MS Ajax (I know people will accuse MS from stealing from the dojo guys now. dojo goes a little further then traceDump... dojo has 2 levels of object dumping: shallow and deep.
  • MochiKit has logging facility like YUI's.

Honorable Mentions
  •'s X Library has some facilities that are more dynamic in nature in that they let you modify the running document as well as drop in debug console's within your code.
  • The addon to Prototype.js contains some unit testing classes.
Final Thoughts

The one most notably missing to me is Prototype.js. I feel that I have to point this out as it seems crazy to me that Prototype of all libraries should have some sort of support for this (at least for writing to the debug console). I'm in shock that it doesn't.

As far as other frameworks, if I missed yours I'm sorry. If yours doesn't have any kind of debugging facility be happy I didn't point it out and add debugging support... I've come to the conclusion that I won't be using a JS library that doesn't have it (it makes life way to convenient when you are trying to debug something).

[this post brought to you by the nice folks at I needed a new editor and this just might be in (well, if this posts ok)]

[tags:ASP.NET,Ajax, MS Ajax, JavaScript, JavaScript Debugging, dojo, the X Library, YUI, MochiKit]

Desperately seeking a MS Ajax newbie...

21 February 2007
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

to do a run-through of an upcoming MS Ajax presentation I'm doing.  If you are available tomorrow, Feb., 22, 2007 at around 7pm and are in the Tampa Bay Area (actually Oldsmar is the location), then please contact me via the contact form on this site, for the actual location. 

 [Actually if you aren't an MS Ajax newbie you are welcome to contact me as well]

MS Ajax ClientScript Cheat Sheets (by me)

20 February 2007
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

I've been spending the last couple weeks in the MS Ajax ClientScript API.  In the process I found myself jumping all over the docs.  I did use the pretty ones given out by someone (I think MS) for a little bit, but I wanted access to everything and generally knew which namespace I was looking for.

As a result I have created my own cheat sheet containing every change to the standard Javascript library made by the MS Ajax Extensions.  It's 10 pages (which if you print it you have 5 pages front and back).  I'll probably make a couple improvements on it, but I like having everything at my fingertips (and not having just some of the documented APIs).  BTW, there were a couple things that the offline docs don't document well (either they point to some other function in some other class or you get a bad link)... Since I went through the entire documentation to do this, I researched this stuff and put the right info in the document.

Also, I broke out the statics from the regular classes, so you know when to use Sys.UI.Behavior.someMethod and when to use MyBehavior.someMethod.  The only thing I didn't mention in my cheat sheets (that you need to remember) is that if something is documented as a property that means that there is a get_propertyName() function/method and (if the property is not readonly) a set_propertyName(value) function/method.

Anyway, I hope you find it useful (I'll probably make a couple updates in time).  BTW, I attached the zipped PDF to this post.

kick it on

[tags: MS Ajax Extensions, MS Ajax, ASP.NET, MS Ajax JavaScript, JavaScript]

MS ASP.NET Ajax Extensions team -- giving some love

16 February 2007
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

When Atlas split and became a CTP and a beta, I was one of the naysayers.  I couldn’t believe what had been done; we had essentially been given the UpdatePanel.  I was so upset that I decided that it was time to move out and look at other Ajax toolkits.  So for last 6 months or so, I sojourned in the lands of Telerik and Yahoo (both of which are excellent toolkits).  About 2 months ago (around the release of MS ASP.NET Ajax Extensions v1), I decided to take a closer look at the end result.  While the main server controls that had been provided were the same, I began to look at the underlying architecture. 

For instance HttpCompression of scripts is a pretty nice feature to have in the realm of Ajax.  Also, I realized that, while the script model no longer has the TextBox or the Label or the ListView, the simpler model is actually highly effective.  Last week I wrote a script-only splitter control with the MS Ajax Extensions in about a few hours (and no I have never built one before).  I’ll be turning it into a server control and will be seeing if I can get it accepted in the Ajax Control Toolbox project.  The process for writing extensions is a lot easier or at least that there are docs that really help you to wrap your head around this stuff (provided you have the background in everything else). 

So despite the fact that the amount of server control in the MS Ajax Extensions seems a little light, the script model is (dare I say it) on par with the ubiquitous Prototype library. I applaud you guys on the MS Ajax Extensions team (sorry it took me so long).

[tags: ASP.NET, Ajax, MS ASP.NET Ajax Extensions, MS Ajax Extensions]

100 reasons??

01 February 2007
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

I was just reading Sam lamenting the fact that Vista had a very disappointing launch. He points to a site claims to give 100 Reasons you’ll be speechless about Vista.  Personally, I’ve not seen anything that would cause me to go “ooooo!  I need this now.”  (I did see reasons for XP, BTW).  I decided to grab the list and see what’s there (and I’m sharing it with you). Basically, this article is meant to prove Sam’s point from the view of someone who hasn’t used Vista, but is a techno-geek (BTW, I really want to like Vista).

I guess one more thing to mention to any ‘softies reading this. I’m not bashing. I love you guys. Between your marketers and lawyers, I’m not terribly interested in Windows Vista.  (below is what I think of the 100 Reasons marketing)

1) Makes using a PC a breeze – this point mentions the new 3d desktop enhancements and the instant search technology.  None of this is compelling to me… I have free search technology I use now with XP, so that doesn’t do it for me.  The 3d enhancements sound cool, but window dressing is window dressing (not really a selling point for me)
2) Mentions that you can use a remote with Media Center… and this is different from XP’ Media Center, how? 
3) Mentions that this is the safest version of windows.  It mentions Windows Defender which I run on XP today.  It also mentions anti-spam, phishing filters, and parental controls. It also mentions a bunch of automatic backups, and performance tuning.  The only compelling thing here for me is the parental controls and it’s not enough.  I have backup software already.  The performance tuning scares me since I’ve had windows decide to tune things before and the next thing I know icons are missing, programs don’t work… past history doesn’t convince me that this is a good thing.  Anti-spam is built-in to my main email (gmail), so that doesn’t cut it.  With IE7, I get phishing filters (and probably the same ones).
4) Mentions the 3d enhancements again… see #1.
5) Mentions the search again… see #1.
6) Mentions the mobility features of Vista (something I don’t know that much about).  It talks about keeping my laptop in sync with my calendar, music, etc.  It also mentions the TabletPC.  Needless to say there is something that intrigues me here, but I’m not “wowed” yet.
7) Mentions Windows Photo Manager.  Another feature I don’t know much about, but I wonder how it differs from the many Photo Managers that have been crammed down my throat by Vendors like HP and Adobe (in other words… I’ve got this I think).
8) Mentions the automated maintenance stuff like backups, performance tuning, etc. See #3.
9) Mentions the wireless networking enhancements…  the features mentioned are things I use today with XP.
10) Mentions IE7… which I can install on XP.
11) Parental controls… See #3
12) Media Center and TV Guide… See #2.
13) IE7 and Phishing Filter… See #3 and #10.
14) Media Center and Media Center Extenders like the Xbox 360… See #2.
15) Automated Backup… See #3.
[I’m starting to think that we are going to have the same 7 or 8 features the whole way down]
16) Mentions Easy Transfer (a feature that has yet to be mentioned!)… how this differs from XP’s Documents and Settings Transfer is beyond me (and I’m not given anything that it doesn’t already do)
17) Windows Sidebar… Ok, this is a cool feature sort of.  I’ve run a number of sidebar enhancements on XP over the last several years… none of which are running on my machine now… I’m over the sidebar as well as Desktop widgets (it’s been done and it’s over).
18) Backup… See #3.
19) Watch Live TV on Windows Media Center… uhh… #2.
20) Easier networking… I guess I thought this was pretty decent in XP.
21) Play games on your TV with Media Center… not compelling… I can do this today with my TabletPC that has TV out.
22) Flip 3D evidently provides a new way of switching between programs and document (in 3d and with a mouse).   Uhh… not compelling for me (maybe for you).
23) Not sure about this one… it seems that Vista is a total entertainment center letting me play movies, games, etc.  I’m “wowed”… not! Again Windows 95 let me do this.
24) Windows Defender… See #3.
25) It’s compatible with most hardware… uhh, great, so I can run it is what this says… the question is do I want to run it? 
26) Quicktabs in IE7… See #10.
27) Mobility Center… See #6.
28) Windows Media Center on the TV (again)… See #2 and #21.
29) Tablet and Touch Technology… While it would be nice to have Tablet improvements… I had a TabletPC… it was fun, but not that much better than a laptop.
30) Restore your PC in an Instant… Ok, I bet a 30gb restore won’t be that instant… See #3.
31) Mentions the background diagnostics and how they can notify you of something being wrong… sounds nice, but the BSOD usually lets me know.. again not quite compelling to me (it’s a nice to have and on top of a couple meaty features this would be icing on the cake).
32) Mentions streamlining group policy and how your users can access data on offline servers… uhh.. that’s amazing!  Vista can predict what I will want and cache’s it or does it cache the entire server on every machine… Seriously, I don’t think any of this is all that different from what we have in XP right now.
33) Mentions Backup and Windows DVD Maker… So it comes with a built-in DVD creation… My Nero does that… so does my Roxio (both of which came with my laptops).  I realize that Vista might have a better set of tools, but what I have works just fine.
34) Connect to a domain… XP does this.
35) Search… See #1.
36) A better photo editor… uhh… not really that compelling…
37) Drive Data Encryption… I hope this works better than it did in XP.. again I’m not really interested in this.
38) A photo editor that removes red-eye… I have one of those for XP (and it was free).
39) Photo Gallery (again)… See #7.
40) Mentions a myriad of new navigation features to make it easier to get where I want… pure marketing fluff to me… Since I do marketing, I can see right through this.  You make statements like this in a marketing document when you have run out of points.  Essentially it means, we have a whole bunch of new stuff (that you’ve already read about) that will make your life better… it says nothing.
41) Automated Windows Update… Uhh Windows XP has this…
42) Photo Manager will compress files for easier Email delivery…. I have utilities that will do this… I bet it doesn’t work with gmail though…
43) Parental features… See #3
44) This one intrigues me… too bad it doesn’t explain itself.  Windows ReadyBoost will somehow speed up my computer by having me stick in a USB memory stick.  Does this mean it’s backing data up to the memory stick?  Is it using the memory stick to increase usable memory?  This one is a wash… if I only was told something a little more about the feature.
45) Media Center does it all in one box… See #2 and #21.
46) Windows Media Player 11… Hmmm, I think that’s the player I’m using right now from XP.
47) Windows Media Player 11 (again)… See #46.
48) Wireless Networking (again)… See #6.
49) Sync Center/Mobility… See #6.
50) Tabbed IE7 (did we mention that IE7 has tabs)… Yep, I know cause I can use it from XP!
51) Games Explorer (organizes your games)… Hey, that one sounds cool… if I installed a lot of games at once.. which I don’t (but then again I’m getting older, so I play a couple games at a time and uninstall what I am not playing)…
52) Parental controls to control game time… Nice addition if I was worried about this… but there is this cool thing called an Alarm clock that can do the same sort of thing.
53) Meeting Space looks cool. I’ll give that one a thumbs up… (wow… we’re like 53 items in and I have flagged like maybe 3 items as in Vista’s favor)
54) Did we mention that there is a flavor of Media Center… See #2.
55) Another you’ll work better with this… see #40… tired marketers is what I say…
56) IE7 (again!)… See #10 (and one of the other 10 IE7 items in this list)
57) Windows DVD Maker (again)…. See #33.
58) Windows Media Player 11 (again)… See #46. (It does mention some of the cool features of Media Player 11, so points for that).
59) Emailing Photos (again)… see #42.
60) Windows Movie Maker… Already in XP although maybe enhanced for HD (since I don’t have HD…)
61) Windows Firewall… Windows Firewall??!!?? I realize that there are probably some enhancements here, but there aren’t mentioned in this point…
62) Windows Fetch monitors and preloads heavily used apps so they start up faster… Nice, but I think XP has something similar inside of it.
63) The Help System… Are they kidding me??!!?? Do I need to rant… this marketing is awful! and this point almost assumes I’ve never used Windows before…
64) File System Encryption… See #37.
65) Faxing and Scanning… Ok, there can’t be too many enhancements here… must be a tired marketer or an exec who wants 100 points even if there are some lame ones.
66) Shadow Copy is cool… if I accidently delete a file it can recover it… Another good one…
67) Windows Mail with Instant Search… See #1 for search… I think I’ve had mail in Windows for a while now…
68) Windows Calendar… Ok, this is a new feature… not one I’m overly wowed about since I have used Outlook as well as I have a PDA that does a better job of organizing me…
69) Improved printing… again another decent feature that is a positive.
70) New Sleep feature… this smells like Hibernate… which works fine in XP.
71) Instant Search has search folders… for a free built-in feature this does sound cool, but #1 still applies…
72) IE7 and RSS… See #10.
73) new spin on saving your home movies and photos… see #33 and #42.
74) Windows Media Center will play music while browsing photos… Since I don’t use my Media Center PC like a Media Center I have no idea if the current version does this or not (does that make it uncompelling… you bet… at least to me)
75) Printing of Photos… Didn’t we hear that already?  Oh yeah #69.
76) Windows Photo Gallery lets you order professional prints of your photos… Hmmm… this sounds like Vista is going to cost me more money in the future… I wonder who paid MS for this one… oops… I mean it’s a feature… and I think I can get stuff of this nature in XP now…
77) Windows Photo Gallery can grab the photos from your camera… uhhh… since my camera mounts as an external drive… not all that difficult… not even for my Dad.
78) Window Media Player 11… See #46.
79) Window Media Player 11… See #46. This does mention buying music which I can do today… <sigh />
80) Multitask burning and watching with Media Center… uhh… See #2 and #21 (for instance)
81) Windows Media Center is a better TV watching experience… hmmm… ever heard of TiVo?  No?  How about what I use GBPVR? (you probably get the picture)
82) Windows Media Center.. your media hub… See last one… BTW, add TVersity to the mix.
83) Windows DreamScene sounds like a cool screen saver… I’ll give you a point on that one
84) Windows Media Center and a remote… <sigh /> See #2
85) Switch languages without rebooting… not sure… I know I have been able to switch formatting around… but since I speak/read exactly 1 language… doesn’t do me a lot of good…
86) Autmatic Backup… see #3
87) Play the hottest games… then goes on to list 4 games I’ve never heard of… It’s cool that Vista comes with games, but if I was a CEO…
88) DirectX 10… Hey another feature not included or available on XP…
89) Games on the go… this is saying you can load your games anywhere and take them with you… This looks like another point that means nothing… I can load games on my Laptop right now and also on my Desktop PC.
90) Windows Slideshow lets machines with secondary screens notify you of important meetings/emails with the machine not even booted up… OK, another cool feature provided you have the hardware (which I don’t).
91) Sync Center.. See #6… BTW, pocket pcs are mentioned here and I know I can put video on my pocketpc already… I guess this must be an “easier” way to do so… this one is sort of a wash…
92) TabletPCs and snipping… some new features for the TabletPC OS that lets the pen be used to snip/copy pieces of info and paste it elsewhere… very cool I guess.
93) Tablet and Touch… Vista is evidently Touch Screen enabled…. uhh… that’s nice.. someday maybe I’ll have a touch screen on something other than my pocketpc.
94) Wireless Security… now with WPA2… I could swear I had been using WPA2 with my Windows XP Media Centerfor some time now…
95) Better productivity when working offline… this one says that the offline access is smarter and will let you take files/folders with you… that’s cool.  Almost “wow.”
96) Remote Desktop… There have definitely been some improvements here (I won’t throw the Windows XP card down on this one).
97) Fax/Scanning devices can be across the network… Ok, I’ll give you that one… although I think I’ve seen this done with WindowsXP.
98) Connect to networked projectors… very nice if you own a networked projector which I imagine some business will invest in.
99) File and Folder sharing has been enhanced… This probably could have used some user-friendliness attached to it, but I’ve never had that much trouble with it.
100) Network Diagnostics… I guess this could be helpful for a newbie…

Again, my post here is not to crap all over Vista… it’s to say that this marketing (and other like it) do nothing to really convince me that I must get Vista (which is what the title of the marketing document implies).  I’ve had to write documents like this before and I know from experience I was always happy when it was over… There aren’t 100 good reasons for anything…So quit it…

[tags:Windows Vista,Vista Marketing]