2012-10-10 2 views
0
내가 가진

에서 작업하고 다음과 같은 방법JQuery와는 IE7

var new_options = { 
      dataType: 'json', 
      beforeSubmit: function() { 
       alert('inside before submit'); 
       $(".available_script_arguments").each(function(index) { 
       argument_id = $(this).val() 
       $("td#argument_"+argument_id).addClass("resource_automation_loader"); 
       });     
      }, 
      success: function(data) { 
       alert('inside success'); 
       $(".available_script_arguments").each(function(index) {      
       argument_id = $(this).val() 
       $("td#argument_"+argument_id).removeClass("resource_automation_loader"); 
       $("td#argument_"+argument_id).html(data[argument_id]).html(); 
       $("td#argument_"+argument_id).html("<span></span>"); 
       updateTargetArgumentId(); 
       triggerAdapterResourceAutomation(); 
       }); 
      }, 
      error: function(jqXHR, textStatus, errorThrown){ 
       alert('inside error'); 
      $(".resource_automation_loader").each(function(){ 
       // This will hide the loader 
       $(this).removeClass("resource_automation_loader"); 
       // This will display text N.A indicating the resource automation has failed 
       $(this).html("<input type='text' value='' placeholder='N.A'></input>"); 
      }); 
      } 
      }; 
      $("form#update_resource_automation_parameters").ajaxSubmit(new_options); 

이 기능에 정의되어 ajaxsubmit 방법은 파이어 폭스에서 제대로 작동하고 있지만 IE7에서 작동하지 .

나는 이유를 알았고 jquery html 함수가 성공 콜백에 사용되었다. 성공 콜백 데이터로서

는 (아래) 성공 콜백

<div > 
<select arg_val="null"> 
<option value="">Select</option> 
<option value="0">Corporate Strategic</option> 
<option value="1">Business Unit Strategic</option> 
<option value="2">Maintenance</option> 
<option value="3">Defect</option> 
</select> 
</div> 

그래서이 데이터는 기본적으로 선택 출력에 데이터를 inspecing 후

HTML로 (DIV의 조합을 선택)오고 목록에 있지만 IE7에서 작동하지 않습니다.

누구든지 이에 대해 알고 싶다면 알려주세요.

감사합니다. 딘.

답변

0

은의 당신이 지속적으로 JQuery와 통해 동일한 개체를 선택하고 대답 라훌하는 html

+0

이미 append와 appendTo로 시도했지만 행운이 없음 –

0

더 대신 append를 사용해보십시오. JQuery에서 작업을 수행하면 영향을받는 개체가 반환되므로 작업을 연결할 수 있습니다. 예를 들어

:

$("td#argument_"+argument_id).removeClass("resource_automation_loader"); 
$("td#argument_"+argument_id).html(data[argument_id]).html(); 
$("td#argument_"+argument_id).html("<span></span>"); 

가 될 수 번만 객체를 선택

$("td#argument_"+argument_id).removeClass("resource_automation_loader") 
          .append(data[argument_id]) 
          .append("<span></span>"); 

.

+0

이 솔루션을 제공해 주셔서 감사합니다.하지만 불행히도 IE7에서도 작동하지 않습니다. –