简体   繁体   中英

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. For example, in a page we have a checkbox within a 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.

Anybody can help me on this? thanks a lot!

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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