| Populating ajax cascading dropdowns from XML is it possible to do this? |
Bewenched

msg:4529543 | 7:03 am on Dec 19, 2012 (gmt 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
|
httpwebwitch

msg:4536531 | 1:53 pm on Jan 16, 2013 (gmt 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.
|
|
|