admin管理员组文章数量:1392073
I keep getting the following error
Error: Error: Syntax error, unrecognized expression: table $MainContent$gridPlans$ctl02$chkSelected Source File: .min.js Line: 2
I have worked what part of the script is causing this issue but unsure how to fix it:
// Check Box selector
$("input:checkbox:not(:checked)").each(function () {
var column = "table ." + $(this).attr("name"); // this line is not working
$(column).hide();
});
$("input:checkbox").click(function () {
var column = "table ." + $(this).attr("name");
$(column).toggle();
});
// Manage column checkboxes that should be unchecked
function manChecks() {
var __CS = document.getElementById('__CS');
var cols = __CS.value; // this line also causing issues
colManage(1, cols.indexOf('|1') != -1);
colManage(2, cols.indexOf('|2') != -1);
colManage(3, cols.indexOf('|3') != -1);
colManage(5, cols.indexOf('|5') != -1);
colManage(6, cols.indexOf('|6') != -1);
colManage(7, cols.indexOf('|7') != -1);
colManage(8, cols.indexOf('|8') != -1);
colManage(9, cols.indexOf('|9') != -1);
}
function colManage(id, show) {
document.getElementById(id).checked = show;
var column = "table ." + id;
if (show) {
$(column).show();
$('label[for=' + id + ']').addClass('checked')
}
else {
$(column).hide();
$('label[for=' + id + ']').removeClass('checked')
}
}
I keep getting the following error
Error: Error: Syntax error, unrecognized expression: table $MainContent$gridPlans$ctl02$chkSelected Source File: http://code.jquery./jquery-latest.min.js Line: 2
I have worked what part of the script is causing this issue but unsure how to fix it:
// Check Box selector
$("input:checkbox:not(:checked)").each(function () {
var column = "table ." + $(this).attr("name"); // this line is not working
$(column).hide();
});
$("input:checkbox").click(function () {
var column = "table ." + $(this).attr("name");
$(column).toggle();
});
// Manage column checkboxes that should be unchecked
function manChecks() {
var __CS = document.getElementById('__CS');
var cols = __CS.value; // this line also causing issues
colManage(1, cols.indexOf('|1') != -1);
colManage(2, cols.indexOf('|2') != -1);
colManage(3, cols.indexOf('|3') != -1);
colManage(5, cols.indexOf('|5') != -1);
colManage(6, cols.indexOf('|6') != -1);
colManage(7, cols.indexOf('|7') != -1);
colManage(8, cols.indexOf('|8') != -1);
colManage(9, cols.indexOf('|9') != -1);
}
function colManage(id, show) {
document.getElementById(id).checked = show;
var column = "table ." + id;
if (show) {
$(column).show();
$('label[for=' + id + ']').addClass('checked')
}
else {
$(column).hide();
$('label[for=' + id + ']').removeClass('checked')
}
}
Share
Improve this question
asked Aug 13, 2012 at 13:45
user1177860user1177860
5094 gold badges13 silver badges24 bronze badges
0
1 Answer
Reset to default 5Your class selector has $
characters in it - these need to be escaped.
Need to escape a special character in a jQuery selector string
jQuery selector value escaping
http://samuelsjoberg./archive/2009/09/escape-jquery-selectors
本文标签: javascriptError Error Syntax errorunrecognized expressionStack Overflow
版权声明:本文标题:javascript - Error: Error: Syntax error, unrecognized expression: - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744780632a2624688.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论