Sep 28, 2009

No Javascript? No Problem!

So we are working writing webpages based off of Ajax in this class, which I find way cool. But we have also discussed browser compatibilities and issues with end users using strange configurations on their computers. What happens to your Ajax if the end user has Javascript disabled? If you haven't written your code to cater to these users, chances are they won't see it. This issue can be even greater if you have decided to run a lean webpage that functions solely on Ajax . . . So what do you do?!

isAjax() will solve your problems. You can use this function to either send an Ajax version of a page if javascript is enabled, or else function will load an entirely new webpage; allowing you the user to still view the content of your webpage. Here's what it looks like:


(from the webpage http://www.gmarwaha.com/)

And a functional example I found:


(from the webpage http://hanuska.blogspot.com/)

I really like this function and think it solves a lot of problems for developers. I have had to deal with browser compatibility issues at my previous job and view functions like these as lifesavers!

1 comment:

  1. Colin, very interesting, i hadn't given much consideration to those working with in-compatible browsers, or more likely quickly discounted them as being "outdated". Reading your post has made me reconsider my haste in previous thoughts. I can see some businesses users disabling Java due to security reaosns, or some odd personal preference. But i still wonder if they would fall into the target market that would be using web-based applications. Definately insights deeper tought into the matter.

    ReplyDelete