The simple beauty of NoJax

Recently I've needed to figure a simple way of updating a web page at each 4 seconds.

The modern web 2.0 option is using AJAX (Asynchronous JavaScript and XML) and this option sounded fine and dandy. Got myself exploring this path, finding some nice tutorials and simple guides that took away the black magic underneath the Javascript to reach the intended results.

However, I was having a lot of troubles to get it working as intended. On some browsers it would work, on some others it wouldn't. On some browsers I would know how to fix the issues while in some others remained a complete mystery.

This was no longer the simple solution I was hoping to apply and found a nice alternative: Meta tags.

The concept is simple, just add a meta tag requesting for the page to be reloaded within some seconds in the future. Simple, practical and works across all browsers.

Some obvious side effects: it will reload the whole page instead of a silent AJAX-style update. Other than that, it does get the job done in a stable manner.

Credits go to the about.com page that has a nice tutorial: http://webdesign.about.com/od/metataglibraries/a/aa080300a.htm

It is nice to enjoy the simple beauty of NoJax.

:)

1 comment:

  1. I too use the meta tag to refresh information on a page of mine. I was able to refresh "part" of a page by making the information I want to update a separate page enclosed in an IFRAME of the main page. In that way only the tiny window I set aside for the IFRAME gets updated.

    I wanted to further cheat the system by having JavaScript on my main page access an element on the sub-page inside the IFRAME. Everything I read about DOM says it's possible, and using browser DOM inspectors I have been able to see the stuff in there, but I draw the line at spending several days - thankfully not all at one time - trying to figure it out. There are some things I need to do in this life that are actually IMPORTANT.

    ReplyDelete