2013-06-01 18 views
-2

我面临这个问题,只是通过切换其中任何一个来完成我的工作。jquery 1.6.2消失1.9.1功能反之亦然

其实我的基本模板已被编码在jQuery的1.6.2,现在我使用的是基于1.9.1库功能GOS这样一些其他的jQuery函数:

<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> 

     <SCRIPT language="javascript"> 
    $(function() { 
     $(":checkbox").change(function() { 
      // Toggle class of selected row 
      $(this).parent().toggleClass("rowSelected"); 

      // Get all items name, sum total amount 
      var sum = 1500; 
      var arr = $(":checkbox:checked").map(function() { 
       sum += Number($(this).parents('tr').find('td:last').text()); 
       return $(this).parents('tr').clone(); 
      }).get(); 

      // Display selected items and their sum 
      $("#selectedServices").html(arr).find('input').remove(); 
      $("#total").text(sum); 
     }); 
    }); 

</script> 

现在,因为该功能当我使用1.9.1与1.6.2这样

<head> 
<script src="http://code.jquery.com/jquery-1.6.2.min.js"></script> 
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> 
</head> 

只有1.6.2支持的功能正在工作,并沿上删除1.6.2不1.6.2,支持,控制台显示我的错误和功能由1.9.1支持(上面给出)正在工作正常 I想让所有的功能支持他们一起工作。怎么做?

+1

哪个函数_is不1.6.2_支持?你的代码可以在两个版本中使用 – undefined

+0

@undefined检查这个http://jsfiddle.net/anujay/uF2Ba/8/你会得到答案 –

+1

这小提琴似乎工作正常,我没有看到控制台中的任何错误。我们在寻找什么问题? –

回答