Hi community,
I am struggeling to get an ajax request to work. The main issue here is that I can't fill in a select box from jquery for some reason. I was working before without jquery and used the method innerHTML() to paste options into the box, which worked fine, but now it's stuck. Here is a snippet of my code
function showResults(source){
var xmlData = $.ajax({
url:source,
async:false
}).responseXML;
var beans = xmlData.getElementsByTagName("quote");
var numOfOptions = beans.length;
var optStr = "";
for(var i=0; i<numOfOptions; i++){
var symbolStr = beans[i].getElementsByTagName("symbol")[0].textContent;
optStr += "<option class='optionLine' value='" + symbolStr + "'>";
optStr += "[" + symbolStr + "]</option>";
}
$('#list1').html(optStr);
}
I call showResults() on window.onload and debugging with firefox shows me that everything works fine, but the insertion, the browser just steps over the last line without inserting anything. The particular html code is
<select id="list1" size="6" class="box190" multiple="multiple"></select>
I am trying now since yesterday various variations, but none of them worked.
Can anybody help me?
Thanks in advance!