내 클라이언트가 JavaScript 클라이언트 측 프로그래머에게 옵션의 순서를 변경하여 페이지가로드 될 때 회사의 옵션이 선택 상자의 맨 위에 표시되도록 요청했습니다.Internet Explorer의 옵션 상자를 바꿀 수 있습니까?
다음 코드는 파이어 폭스에서 작동하지만 두 가지 옵션을 교환 할 때 Internet Explorer 7에서 실패
shippingLocation.options[0] = swap;
: 나는 바닥에서 세 번째 줄에 다음에 오류가
function load{
var shippingLocation = document.getElementById("location");
var swap = null;
var initiallyFirstItem = shippingLocation.options[0].cloneNode(true);
var lastPos = null;
for(var i = 0; i < shippingLocation.length; i++)
{
if(shippingLocation.options[i].value == "XETEX")
{
swap = shippingLocation.options[i];
lastPos = i;
break;
}
}
console.debug("sl: " + shippingLocation.options[0]);
console.debug("s: " + swap);
shippingLocation.options[0] = swap;
shippingLocation.options[lastPos] = initiallyFirstItem;
shippingLocation.selectedIndex = 0;
}
을
"개체가이 속성 또는 메서드를 지원하지 않습니다."라는 오류가 표시됩니다.
전환 옵션 항목이있는 Internet Explorer의 쇠고기는 무엇입니까?
내가 다행 도움을 줄 수 =] – Salty