Я пытаюсь прикрепленным некоторым JQuery для флажков в GridView, используя document.ready:
$(document).ready(function()
{
var chkBox= document.getElementById(gvTimeSheet_ctl01_chkAll1);
//I can alert chkBox.id, element exists
var name = $(input[name='gvTimeSheet$ctl01$chkAll1']);
//Here, when I alert the id, I get a null
var ID = $(#gvTimeSheet_ctl01_chkAll1);
//Here, when I alert the id, I get a null
var withClass = $(.chkAll1Class);
//Here, when I alert the id, I get a null
var withClass2 = $(.Bill1);
//Here, when I alert the id, I get a null
//This line causes the browswer to crash and gives me the following error
//Microsoft JScript runtime error: 'null' is null or not an object
$(#gvTimeSheet_ctl01_chkAll1).click(function()
{
var checked_status = this.checked;
$(input[class=Bill1]).each(function()
{
this.checked = checked_status;
});
});
});*/
Итак, почему любые попытки найти объект нуль в JQuery, но существуют в обычном JavaScript в пределах того же метода? Что я здесь отсутствует. У меня есть JQuery файлы принесли расслоение плотной в в теге сценария непосредственно над этим методом. Я просто не могу найти какие-либо объекты на этой странице с JQuery. На других страницах, я могу.













