Wednesday, April 23, 2008

Get the querystring using JavaScript and Chaining

Okay, so this is going to be a very short pot... 'cause I don't have that much to say... except that everyday I use JavaScript, I like it more! Sure there are lots of drawbacks to it such as cross browser/os compatibility, and cross server insecurities... but you can do a lot to mitigate those issues, especially if you work with a good framework such as jQuery or YUI...

So what's the point of this whole post? Earlier today I created a js file that records metric information about website visitors... a pretty simple script... gather information such as screen resolution, user agent, color depth, ip address, session id, login id, etc and send it to a server side script to record the data.

So, one of the pieces I wanted to collect was the querystring. I wanted a clean one line solution to gathering that string.

I knew that window.location.href would give me the string version of the url currently in the browser so I thought I could split on the "?" resulting in "window.location.href.split('?')" Which in turn gave me an array containing 2 elements, the host string and the querystring... I am only interested in the query string... knowing that JS now treats the result as an array, I can grab the array element 1 (which is 2 in most programming languages...) like this: "window.location.href.split('?')[1]"... and there I have it!

Wednesday, April 16, 2008

Speed up your website

The creators at Yahoo have done it once again! What started as 13 rules became 14, the 23, and now 34 best practices for speeding up your website. This is a GREAT article and a MUST READ for any web developer. These 34 items are sorted into 7 categories. Some are pretty advanced and require changes in your server configuration, but many of them are simple changes in your practices that can have a profound change on the the speed of your website, or at least the perceived speed, which is just as important.

Wednesday, April 9, 2008

Google is once again pushing the limits...

Google has recently released in limited beta a SDK/App Engine/Framework called the Google App Engine, to which you can develop web based applications using the same infrastructure that software like GMail, Google Calendar, and the other Google Apps have been created on, and then host them on the Google servers... their SDK/API is pre-built to handle scaling and heavy traffic loads (up to 5M pageviews/mo with a free account) and increasing storage needs (500mb on free account)... also they give direct access to Google mail API, Google file storage, Google "Datastore" (their db system) and plan on taping into others like calendar... Also, you can use your own custom domain names to point to your apps... Finally, Google is allowing you to use their authentication system for authenticating your users! No more asking users to create yet another login for yet another web application!

Now I'm not saying this is better than hosting your own server, but it is pretty stink'en cool!

One downside is that it currently supports only Python... I might be learning a new programming language! =)