Hi I have made a button through html and I am trying to get an XML page to appear when the button is clicked. I need to do this through javascript however it doesnt seem to be working for me.
My HTML:
<input type="button" value="Shop 1" id ="one">
<input type="button" value="Shop 2" id ="two">
<input type="button" value="Put Selected Pictures in Cart" id ="three">
My JavaScript:
function getData(filename) { env = new XMLHttpRequest(); env.open("GET", filename); }
function init()
{
document.getElementById('one').onclick = function(){ getData('shop1.xml'); }
document.getElementById('two').onclick = function(){ getData('shop2.xml'); }
}
Any help would be appreciated. Thanks.
getDatafunction...