Welcome to WebmasterWorld Guest from 54.198.106.21

Forum Moderators: open

Message Too Old, No Replies

Populating ajax cascading dropdowns from XML

is it possible to do this?

     
7:03 am on Dec 19, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:July 26, 2006
posts:1619
votes: 0


I'm familiar with XML for data feeds etc, but have never used it for our actual site. Currently we have 3 dependent dropdowns that are just using javascript to pull the dependencies....

I was thinking the other night, wouldn't it be great to just have a flat xml file for this type of implementation with ajax and save ourselves the server load on queries, but I don't even know if this is possible.

If it is possible, does anyone have an example...

Sadly I'm not using PHP on this project, it's classic asp/vb
1:53 pm on Jan 16, 2013 (gmt 0)

Senior Member from CA 

WebmasterWorld Senior Member httpwebwitch is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 29, 2003
posts:4061
votes: 0


If you're preloading the data to populate the dropdowns, then I'd define the dependencies using JSON, not XML. Just make a big object and then access parts of the object to create your <option> nodes.

In the case you're doing AJAX to get the dropdown contents, reading and grabbing data from a large XML file will be slower than getting the same info from a similarly-sized SQL table.

In either case, caching the AJAX output in something like Redis or Memcached will provide speed.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members