简体   繁体   English

某些jQuery代码在VS2012中不起作用,但在VS2010中工作正常

[英]Some jQuery code not working in VS2012, but works fine in VS2010

We just upgraded our code to .Net 4.5 and are using VS2012 now, but some jQuery code doesn't work anymore. 我们刚刚将代码升级到.Net 4.5,现在正在使用VS2012,但是某些jQuery代码不再起作用。 For example, in a page we have a checkbox within a DataGrid. 例如,在页面中,我们在DataGrid中有一个复选框。

Code to get the list of checkboxes: 获取复选框列表的代码:

$('input:checkbox[id$=MappingGrdCb]').each(function() {
    //....
}

This works fine in VS2010, $('input:checkbox[id$=MappingGrdCb]') returns an array of checkboxes, but in VS2012, it's empty. 这在VS2010中工作正常, $('input:checkbox[id$=MappingGrdCb]')返回复选框数组,但在VS2012中为空。

Anybody can help me on this? 有人可以帮我吗? thanks a lot! 非常感谢!

而不是ends with selector尝试此Attribute contains selector

$('input:checkbox[id*="MappingGrdCb"]') 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM