Javascript jquery html(html_内容)函数在IE-7中似乎不起作用

Javascript jquery html(html_内容)函数在IE-7中似乎不起作用,javascript,ruby-on-rails,jquery,Javascript,Ruby On Rails,Jquery,我有一个和ajaxsubmit方法,它的定义如下 var new_options = { dataType: 'json', beforeSubmit: function() { alert('inside before submit'); $(".available_script_arguments").each(function(index) { argu

我有一个和ajaxsubmit方法,它的定义如下

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);
var新选项={
数据类型:“json”,
提交之前:函数(){
警报(“提交前进入内部”);
$(“.available\u script\u arguments”)。每个(函数(索引){
参数_id=$(this).val()
$(“td#argument_uu”+argument_uid).addClass(“资源自动加载器”);
});                 
},
成功:功能(数据){
警惕(“内部成功”);
$(“.available_script_arguments”)。每个(函数(索引){
参数_id=$(this).val()
$(“td#argument_uu”+argument_uid).removeClass(“资源自动化加载器”);
$((“td#argument_u”+argument_id).html(data[argument_id]).html();
$(“td#argument u”+argument id).html(“”);
updateTargetArgumentId();
triggerAdapterResourceAutomation();
});
},
错误:函数(jqXHR、textStatus、errorshown){
警报(“内部错误”);
$(“.resource\u automation\u loader”)。每个(函数(){
//这将隐藏加载程序
$(this).removeClass(“资源自动化加载程序”);
//这将显示文本N.A,指示资源自动化已失败
$(this.html(“”);
});
}
};
$(“表格更新资源自动化参数”).ajaxSubmit(新选项);
此功能在Firefox中正常工作,但在IE7中不起作用

我找到了原因,并在成功回调中使用了jqueryhtml函数

在成功回调中,数据以html形式出现(div和select的组合)

在成功回调中检查数据后(如下所示)


挑选
企业战略
业务部门战略
维修
缺陷
因此,这些数据基本上输出到视图中的选择列表,但这在IE7中不起作用

如果有人对此有任何想法,请告诉我

谢谢,
Dean.

尝试使用
附加
而不是
html

拉胡尔的答案,你不断地通过jquery选择相同的对象。 当您在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_uu”+argument_uid).removeClass(“资源自动化加载程序”);
$((“td#argument_u”+argument_id).html(data[argument_id]).html();
$(“td#argument u”+argument id).html(“”);
可以成为:

$("td#argument_"+argument_id).removeClass("resource_automation_loader")
                             .append(data[argument_id])
                             .append("<span></span>");
$(“td#argument_uu”+argument_uid).removeClass(“资源自动化加载程序”)
.append(数据[参数\u id])
.附加(“”);

只选择一次对象。

感谢您提供此解决方案,但不幸的是,这在IE7中也不起作用
$("td#argument_"+argument_id).removeClass("resource_automation_loader")
                             .append(data[argument_id])
                             .append("<span></span>");