I wrote some javascript that works perfect in firefox but of course not the case it IE - IE 7 actually IE gave me the error - null is null or not an abject at point beyond this line this line - var select = document.getElementById("make_options"); if I comment out one line - the error goes to the next line It's whenever I do anything to the select variable I'm stuck - any help would be greatly appreciated Here is the whole function // transform the JSON results into a drop down menu var select = document.getElementById("make_options"); select.disabled=false; // enable the dropdown select.onchange=getModels; select.options[select.selectedIndex].disabled=true; // disable the 'Loading...' option select.options[select.selectedIndex].text="Select Make"; for (var i = 0; i < json.feed.entry.length; ++i) { var entry = json.feed.entry[i]; //isPreloading = false; // find the make entry if (entry.title.$t == "make(text)") { makeList = entry['gm$attribute']['gm$value'] for (var j=0; j<makeList.length; ++j) { var option = document.createElement("option"); make = makeList[j].$t option.appendChild(document.createTextNode(make)); select.appendChild(option); } break; } } Code (markup):
After a call to getElementById you should always check that you actually have a DOM element. eg: var select = document.getElementById(id); if(!select) // error handling here - throw an exception, popup an alert, or just return etc