나는 변화하는 이벤트로 주소를 변경하는 프로젝트의 일부로 작업하고 있습니다. 주소 정보는 json 배열로 전달됩니다.SCRIPT5007. IE7 함수를 읽을 수 없습니다.
불행히도 제 작성한 코드는 IE7에서 작동하지 않습니다. 이미 사용 가능한 브라우저의 대부분을 사용하여 목표를 달성 할 수 있었지만 IE7에서이 문제를 해결하는 방법을 알 수 없습니다. 여기 기능을 사용하고
<script type="text/javascript">
var remote_self_json_branches_text = <?=$remote_self_json_branches?>;
function selfOfficeChangeText(element)
{
console.log(remote_self_json_branches_text);
$(".self_del").css('display', 'none');
$("#self" + $(element).val()).css('display', 'block');
}
function change_delivery_office_selection_text (branch_id) {
var cityMap = '';
if(branch_id == 1){
$('.textBlockContainer #self .headerImage').removeClass('remote-self').addClass('self');
}
if(branch_id == 2){
$('.textBlockContainer #self .headerImage').addClass('remote-self').removeClass('self');
}
if(branch_id == 3){
$('.textBlockContainer #self .headerImage').addClass('remote-self').removeClass('self');
}
$(".cityBranch").css('display', 'none');
$("#city" + branch_id).css('display', 'block');
}
$(document).ready(function(){
var mapUrl = '<?= $deliveryOffices[1]['mapCoordinates']?>';
dom('delivery_office_title_text').innerHTML = remote_self_json_branches_text[1].v_title;
dom('delivery_office_address_text').innerHTML = '<a class="mapPopup" href="' + mapUrl + '">' + remote_self_json_branches_text[1].v_address + '</a>';
dom('delivery_office_work_time_text').innerHTML = remote_self_json_branches_text[1].v_work_time;
var mapUrl = '<?= $deliveryOffices[2]['mapCoordinates']?>';
dom('delivery_office_title1_text').innerHTML = remote_self_json_branches_text[2].v_title;
dom('delivery_office_address1_text').innerHTML = '<a class="mapPopup" href="' + mapUrl + '">' + remote_self_json_branches_text[2].v_address + '</a>';
dom('delivery_office_work_time1_text').innerHTML = remote_self_json_branches_text[2].v_work_time;
var mapUrl = '<?= $deliveryOffices[3]['mapCoordinates']?>';
dom('delivery_office_title2_text').innerHTML = remote_self_json_branches_text[3].v_title;
dom('delivery_office_address2_text').innerHTML = '<a class="mapPopup" href="' + mapUrl + '">' + remote_self_json_branches_text[3].v_address + '</a>';
dom('delivery_office_work_time2_text').innerHTML = remote_self_json_branches_text[3].v_work_time;
});
</script>
:
이SCRIPT5007: The value of the property "selfOfficeChangeText" is null or undefined, not a Function object
내 생각 엔 브라우저가 수행되지 않도록 :
<div class="win-xp selCont">
<select name="delivery_office" id="delivery_office_text" class="post_lt_branch" onchange="selfOfficeChangeText(this); change_delivery_office_selection_text(this.value);">
<option value="0">-- <?=t('Pasirinkite')?> --</option>
<?php foreach ($deliveryOffices as $key => $val) { ?>
<option address="<?=$val['city']?>, <?=$val['address']?>" value="<?=$val['id']?>" title="<?=$val['city']?>, <?=$val['address']?>" <?php echo ($val['id'] == 1) ? 'selected' : ''; ?>><?=$val['name']?></option>
<?php } ?>
</select>
</div>
나는이 오류가 여기 내 코드의 조각이다 자바 스크립트를로드 할 충분한 시간이 있습니다. 브라우저 간 호환성에 익숙하지 않아 도움이 될 것입니다. 미리 감사드립니다.
IE7 선택 요소에 값 속성이 없다는 것이 문제라고 생각합니다. 그 오류 메시지는 매우 혼란 스럽습니다 ....''selfOfficeChangeText "'는 속성이 아닙니다! –
"selfOfficeChangeText"는 select onchange 속성에서 사용하는 함수입니다. 모든 옵션은 php로 전달되는 id 값을가집니다. value = " = $ val [ 'id']?>"코드가 너무 깔끔하지 않기 때문에 아마도 이해하기가 어려울 것입니다. 그러나 요점은, 크로스 브라우저 호환성에 대한 미묘한 차이가 있다는 것입니다. –
그건 내가 의미하는 것이 아닙니다. 내가 말하고자하는 것은 IE7 select 요소 노드가 value 속성을 가지고 있지 않을 수도 있다는 것입니다. 이는 값이 선택되지 않았다는 것을 의미하지 않으며 IE7의 dom 엔진이 select 요소의 value 속성에 값을 배치하지 않는다는 것을 의미합니다. 나는 그것을 재현 할 수 없기 때문에이 시점에서 추측하고있다. –