不兼容我已經創建了一個腳本,可根據所選類別更改組合框。問題是該腳本在除Internet Explorer(版本7+)以外的所有其他瀏覽器中都可以使用。我沒有收到錯誤消息,這表明IE不喜歡object.innerhtml。我能做些什麼來解決這個問題?Javascript(object.innerhtml)與IE
工作實例:http://adcabinetsales.com/style-chooser.html
function ChangeCabinetCollection() {
if (document.getElementById("cabinet_collection").value == "broughton") {
// COPY VALUES
var first = document.getElementById('broughton_styles');
var options = first.innerHTML;
var second = document.getElementById('cabinet_selector');
// REPLACE VALUES
second.innerHTML = options;
// CHANGE CABINET IMAGE TO BE IN THE COLLECTION OF CHOICE
changeDoor("cabinet_selector");
} else if (document.getElementById("cabinet_collection").value == "specialty") {
// COPY VALUES
var first = document.getElementById('cabinet_style');
var options = first.innerHTML;
var second = document.getElementById('cabinet_selector');
// REPLACE VALUES
second.innerHTML = options;
// CHANGE CABINET IMAGE TO BE IN THE COLLECTION OF CHOICE
changeDoor("cabinet_selector");
}
}
function ChangeGraniteCollection() {
if (document.getElementById("granite_collection").value == "new_arrivals") {
// COPY VALUES
var first = document.getElementById('granite_new');
var options = first.innerHTML;
var second = document.getElementById('granite_selector');
// REPLACE VALUES
second.innerHTML = options;
// CHANGE CABINET IMAGE TO BE IN THE COLLECTION OF CHOICE
changeGranite("granite_selector");
} else if (document.getElementById("granite_collection").value == "Specialty Styles") {
// COPY VALUES
var first = document.getElementById('specialty_granite_styles');
var options = first.innerHTML;
var second = document.getElementById('granite_selector');
// REPLACE VALUES
second.innerHTML = options;
// CHANGE CABINET IMAGE TO BE IN THE COLLECTION OF CHOICE
changeGranite("granite_selector");
}
}
我看在IE 10的例子,它是工作 – Aguardientico