$(document).ready(function(){ // load jQuery 1.5
function loadfail(){
alert("Error: Failed to read file!");
}
function parse(document){
$(document).find("el").each(function(){
var optionLabel = $(this).find('text').text();
var optionValue = $(this).find('value').text();
$('#el').append(
'<option value="'+ optionValue + '">' + optionLabel + '</option>'
);
});
}
$.ajax({
url: "ednlevel.xml", // name of file with our data - link has been renamed
dataType: 'xml', // type of file we will be reading
success: parse, // name of function to call when done reading file
error: loadfail // name of function to call when failed to read
});
});
The above code works fine with Firefox but it isn't working on chrome or Internet Explorer. What is wrong with it?