Archive for January, 2007

‘Synchronous AJAX’ or SJAX for Short

Saturday, January 27th, 2007

We had a problem at work the other day, we had a piece of JavaScript code that was making an AJAX style web server call, unfortunately other UI elements on the page required the results of that call to be available before the user attempts to use them. I tried searching the web for all sorts of things, ’synchronous ajax,’ ‘ajax wait for response’ etc., leading to many explanations of the differences between asynchronous and synchronous requests, but no indication on how to do a synchronous request.

Finally, by looking through the JavaScript documentation for the XMLHttpRequest object and discovered that by simply adding an additional ‘false’ parameter to the normal http.open() call it forces the XMLHttpRequest object to run in synchronous mode. Exactly what we were looking for!

Here is an example: xmlhttp.open(”GET”, url, false);

This solved our problem completely, but since it was a difficult solution to find I figured I would post an example here in hopes of spreading the word of this useful tool.

Hope that helps!

Getting things done…

Thursday, January 25th, 2007

Wow, what a busy holiday season that was! Always is this time of year, Christmas, the New Year, my birthday and anniversary all within a two week span. There was so much going on that it is all very overwhelming and exhausting. Even after the holidays it felt like no matter how hard I worked nothing seemed to get done.

Finally I have been able to start digging myself out from underneath the pile. Many of the things that have been on my todo list for months have suddenly been completed, plus many more recent items. Here’s the plan I have been following to keep it going:

  • Keep a detailed list of everything that I need to do
  • Get rid of anything on the list that doesn’t actually matter
  • Finish things before I move on to the next, don’t leave items @ 90% complete
  • When something is finished, put it away so that it’s out of my mind
  • Re-prioritize my to do list often in achievable chunks, starting the whole process over again

The results have been good, as I get caught up, my head feels more clear and I’m actually able to get things done even faster. This week I’ve scratched 3 times as much stuff off of my lists as I have in previous weeks, and we all know how good it feels to get out that marker and cross something off our list. I no longer feel like I’m buried under a pile of stuff.

So give it a try if you like, let me know how you make out.