r/javascript•
Raekwon

Is it possible to populate a html combobox from xml file using javascript?

I need to create a webapp (a modified contact us form) that I can run on a local network. I am unable to install any software so I am exploring the possibility of using html and js to read and write from an xml file.

I am hoping to populate a combobox of names based on an xml file of staff members.

keeping in mind I am restricted to using xml instead of a database and I am unable to install software. Is js the correct tool I should be using?

Thanks

Posted Feb 14, 2015, 3:42 AM UTC

35
kyrul•

What's stopping you from just using a portable distribution of any language? If the restriction is that you can only create/modify files, you could also use something like sqlite.

1
RaekwonOP•

I wasn't aware these existed. Is sqlite something that I can just unzip on a shared drive and use from there?

1
kyrul•

I don't see why that wouldn't work. The database file, a DLL, and a language that supports it would be all you need.

1
tbremer•

jQuery offers a $.parseXML() function that allows you to take XML and traverse it using normal jQuery selectors.

You can get the XML using a simple $.get() function.

1