var js_ = 'template_form'
var js_em = "#"+js_+""; // 圈定选择器范围
success: function (data){
alert($("#template_form [id=subject]").val());
if (data != null) {
$(js_em+" [id=subject]").val(data.template_subject);
$(js_em+" [name=mail_type]").each(function(){
if($(this).val() == data.is_html) {
$(this).attr("checked",'checked');
} else {
$(this).attr("checked",'');
}
});
$(js_em+" [id=template_content_box]").html(data.template_content);
close_position_js_box();
}
}页面太多ID 和 NAME 所以在选取的时候想圈定个范围,免得以后有冲突,但这样写IE下可以,FF下就不行。。alert($("#template_form [id=subject]").val()); 打出来在FF下是不行滴。。怎么改,或者像这样圈定个范围还有什么别的好方法来圈定?
var js_em = "#"+js_+""; // 圈定选择器范围
success: function (data){
alert($("#template_form [id=subject]").val());
if (data != null) {
$(js_em+" [id=subject]").val(data.template_subject);
$(js_em+" [name=mail_type]").each(function(){
if($(this).val() == data.is_html) {
$(this).attr("checked",'checked');
} else {
$(this).attr("checked",'');
}
});
$(js_em+" [id=template_content_box]").html(data.template_content);
close_position_js_box();
}
}页面太多ID 和 NAME 所以在选取的时候想圈定个范围,免得以后有冲突,但这样写IE下可以,FF下就不行。。alert($("#template_form [id=subject]").val()); 打出来在FF下是不行滴。。怎么改,或者像这样圈定个范围还有什么别的好方法来圈定?
var _temp=$("#template_form);
$("#subject",_temp)
$("*[name=template_form][id=subject]")
alert($("#template_form [id=subject]").val());
$("*[name=template_form][id=subject]")
这些都在火狐下不能成功。IE下却没事
<form action="" method="post" name="template_form" id="template_form"><tr>
.......
</tr>
</form>
</table>原为为了不让form占一格高度,经常把form放在table和tr之间,结果,结果,,,,恰恰就是这个东东,导致在FF下出问题,以刚刚那种形式的选择器选不到东东但在IE下就正常
<form action="" method="post" name="template_form" id="template_form"><table>
<tr>
.......
</tr>
</table>
</form>把form拉上来后就正常了血的教训啊,虽然问题解决。还是不知道所以然望高手进来诊断下