jQuery中的这一行与$
一起使用。
$fname=$(":file:nth-of-type(" + $i + ")").val();//this is working in jquery
但是当我转换为 noConflict 模式时,以下行不起作用:
$fname=jQuery(":file:nth-of-type(" + $i + ")").val();//this is not working
我的代码是:
jQuery(document).ready(function () {
jQuery(document).on("change", "#iefile456", function () {
$nod=jQuery("#item1");
$i =1;
while($nod.html() != "" ){
$nod=$nod.next();
$i=$i+1;
}
alert($i);
$fname=jQuery(":file:nth-of-type(" + $i + ")").val();
alert($fname);
});
});
alert($i)
正在运作,但alert($fname)
无效。