Jquery:在Internet Explorer 7中克隆和修改后无响应的选择字段

时间:2012-08-13 18:54:31

标签: jquery html internet-explorer-7

由于我已经在这里找到了几个问题的答案,我确信有人可以回答以下问题。

我已经通过Ajax编写了一个选择框的更新。在Internet Explorer 8 +,Opera和Firefox中一切正常。但是当我在开发工具(F12)中选择Internet Explorer 7或Quirks时,它无法正常工作。我连续3个选择字段;在选择第一个之后填充最后两个。这很有效。

现在问题:克隆并在之后添加完整行以允许多个选择。对于第一行,它可以工作,但之后却没有。

如果第二个和第三个选择应该更新,它只更新第一个OPTION条目,而select字段似乎有一个bug,因为它没有下拉.....我已经检查了有问题的Pulldowns是否有正确的HTML内容和jquery $().html()带来的HTML内容正是函数更新选择字段后我想要的内容。

<div id="diagrammpreview" style="height:500px;width:500px;"></div>
<div id="d1">
<div id="diagramm1">
<select size="1" class="overviewtables" name="overviewtables"><option value="error">Bitte auswaehlen</option></select>
<select size="1" class="axis" name="axis1"><option value="error">Zuerst Tabelle auswaehlen</option></select>
<select size="1" class="axis" name="axis2"><option value="error">Zuerst Tabelle auswaehlen</option></select>
<input type="button" id="preview1" class="preview" name="preview1" value="Preview">
</div>  

这是克隆的部分:

$('#adddiagramm').click(function(){$('#d1').children().last().after($('#diagramm1').clone())


function fillpulldown(val,text,j_pulldown,a)
{
 var newcontent="<option value=\"error\">"+"Bitte auswaehlen"+"</option>";
 for(i=0;i<=(val.length-1);i++)
 {

 if(val[i]=="timestamp"){}
     else
     {
        newcontent=newcontent+ "<option value=\""+val[i]+"\">"+text[i]+"</option>";
     }
 }
    alert(newcontent);
 j_pulldown.html(newcontent);
 alert(j_pulldown.parent().html());
 alert(j.pulldown.html());
}

此功能填充下拉菜单。它有效,但IE7似乎没有解析j_pulldown.html(newcontent)部分的权利。问题仅出在CLONED内容上。

0 个答案:

没有答案