2012-04-04 8 views
0
<div class="dis-opt-box"> 
<div class="dis-opt-box-top"> 
     <form id="frmBook" accept-charset="utf-8" action="http://localhost/parcel3/book" method="post"> 
     <div class="opt-box-heading"> 
      <div class="service opt-box-heading-txt">Service</div> 
      <div class="price opt-box-heading-txt">Price</div> 
      <div class="info opt-box-heading-txt">Info</div> 
      <div class="coll-tody opt-box-heading-txt">Collection today</div> 
      <div class="printer-needed mt_5">Printer needed</div> 
      <div class="enhanced opt-box-heading-txt mt_5">Enhanced compensation</div> 
      <div class="drop-off opt-box-heading-txt mt_13">Drop off at <br>Parcelforce <br>Worldwide <br>Depot</div> 
    </div> 
            <div class="economy-services"> 
         <h3>Next Day, Pre 9am delivery</h3> 
                  <div class="service-box"> 
             <div class="service-box-small"> 
              <div class="service-box-small-1"><span class="pl-10">Parcelforce Express 24, Pre 9am</span></div> 
              <div class="service gray-border"> 
                           <img src="/parcel3/web/img/uploads/couriers/parcel2shippf.jpg" alt="Parcelforce Express 24, Pre 9am" title="Parcelforce Express 24, Pre 9am" class="pb-23" />           </div> 
              <div class="price1 gray-border"> 
               <a href="#" class="flyout">&pound;15.99<span style='width:300px;'><div style='float:left; width:250px; text-align:left;'>Base Price: </div><div style='float:left; width:50px; text-align:left;'>&pound;15.99</div><div style='float:left; width:250px; text-align:left;'>Remote Area Charge: </div><div style='float:left; width:50px; text-align:left;'>&pound;0.00</div><div style='float:left; width:250px; text-align:left;'>Number of Packages: </div><div style='float:left; width:50px; text-align:left;'>1</div><div style='float:left; width:250px; text-align:left;'>Sub total: </div><div style='float:left; width:50px; text-align:left;'>&pound;15.99</div><div style='float:left; width:250px; text-align:left;'>VAT: </div><div style='float:left; width:50px; text-align:left;'>&pound;3.20</div><div style='float:left; width:250px; text-align:left;'>Grand Total: </div><div style='float:left; width:50px; text-align:left;'>&pound;19.19</div></span></a> 
               <div class="red-star">*</div>           </div> 
              <div class="info gray-border "> 
               <a href="#" class="flyout"><img src="/parcel3/web/img/images/info-icon.png" alt="" /><span>Delivery before 9am on next working day to most of the UK. Door to door service. Each consignment covered for compensation up to a maximum of &pound;50.00 as standard. Trackable on line. Full support and backup. Fast and reliable courier service from a top courier company.</span></a> 
              </div> 
              <div class="info gray-border" style="background:none;"> 
              <img src="/parcel3/web/img/images/question.png" alt="Collection today can only be shown when a collection postcode has been supplied" title="Collection today can only be shown when a collection postcode has been supplied" />           </div> 
              <div class="printer-needed gray-border"> 
              <img src="/parcel3/web/img/images/available.png" alt="Available" title="A printer is needed for this service. You will need to print shipping labels and attach them to your parcel" />           </div> 
              <div class="enhanced gray-border"> 
              <img src="/parcel3/web/img/images/available.png" alt="Available" title="Available" />           </div> 
              <div class="drop-off gray-border"> 
              <img src="/parcel3/web/img/images/available.png" alt="Available" title="Available" />           </div> 
             </div> 
             <div class="green-button"> 
              <button type="button" value="21" class="book" onclick="javascript:addPackageDetails('/parcel3/web/index/addPackageDetails','21');">Book</button>          </div> 
            </div> 
                </div> 
                <div class="vat-extra">* Plus VAT</div> 
           <div class="clear"></div> 
     <input name='data[packageOptions][0]' type='hidden' value='' id='packageOptions_0'/> 
     <input name='data[hdnChoosePackage]' type='hidden' value='1'/> 
    </form> 
    </div> 
<div class="dis-opt-box-bottom"></div> 
</div> 

이 HTML은 Ajax 응답에서 가져 왔습니다. innerHTML을 사용하여 DIV에이 HTML을 추가하려고합니다. Firefox, IE9, Crome, Safari에서는 정상적으로 작동하지만 IE8에서는 작동하지 않습니다.innerHTML이 IE8에서 작동하지 않습니다.

아무도 도와 줄 수 있습니까?

나는 응답으로이 HTML을 가지고이 코드를

document.getElementById('chooseDetail').innerHTML = response; 

를 사용하지만 IE8에서 작동하지 않습니다.

+0

전체 AJAX 코드를 볼 필요가 있습니다. DOM에 추가하려는 실제 콘텐츠는 관련성이 없어야합니다. – DaveRandom

+0

당신의'innerHTML' 설정자가'innerText'를 호출하고 있습니다 – Churk

+1

당신의 질문에 "innerHTML"이라고 쓰여 있지만 코드는 "innerText"라고합니다. innerHTML을 사용해 보셨나요? –

답변

0

IE8은 내용이 조금 더 엄격하다고 생각합니다. 대신이 기능을 사용하려면 innerHTML을 실행해야 할 수도 있습니다.

+0

감사합니다. 그것의 일 벌금 $ ('# chooseDetail') .html (응답); IE8에서도. –

0

<br><br/>으로 바꿔보십시오. 일부 IE 버전은 유효한 HTML 태그를 사용하는 것에 대해 엄격합니다.

+0

아니 작동하지 않는, 나는 몇 가지 다른 문제가 있다고 생각합니다. –

관련 문제