2009/08/27

DHTML State Selection

Filed under: osCommerce Coding — Tags: , , — eCartz @ 15:15  Share/Bookmark  Delicious  StumbleUpon  WordPress  Twitter  LinkedIn

In response to a request on the osCommerce forums, I wrote up a method for changing automatically among drop downs for the various zones and the text input.  The request was made to get it bundled into a contribution, and since there was unfinished work, I went ahead and did it.  The DHTML State Selection Add on is now available.   Further looking, also revealed that there is at least one other contribution available for this, the AJAX based Country-State Selector

This brings up a point about the difference between DHTML and AJAX.  AJAX is the new sexy term for fancy javascript and is often used to describe things that are really DHTML.  AJAX stands for Asynchronous Javascript And XML.  DHTML stands for Dynamic HTML.  DHTML is taking the HTML that appears in the page and making changes to it with Javascript.  AJAX is making a small web request to get an XML response.  People often then use the AJAX information in DHTML changes that they make to the page.  This has led to people calling DHTML widgets AJAX. 

My add on is plain DHTML.  It generates all the required drop downs on the server and hides them via a display:none CSS style.  The Javascript that I wrote then turns on display of the appropriate menu when a country is selected from the countries menu.  With all the zones installed, it’s a relatively heavy weight page.  On the bright side, most of the page displays before it gets bogged down in creating the menus.  Someone can enter name, street, zip, and city while waiting for the state and country to load. 

The other add on apparently uses AJAX to load the menus.  Presumably this makes the initial page load faster (fewer menus to send), but it also suggests that there will be a lag after the country is selected, while it loads the new menu.  An interesting future project might be to do a performance comparison of the two contributions. 

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

You can log in to post a comment, or just fill out your name and email.

Powered by WordPress