Ι Προσπαθώ να επισυνάπτεται κάποιο 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;
});
});
});*/
Έτσι, γιατί κάθε προσπάθεια για την εξεύρεση μιας null αντικείμενο σε jQuery, αλλά υπάρχουν σε τακτική javascript εντός της ίδιας μεθόδου; Τι είμαι εγώ που λείπει εδώ. Έχω αρχεία του jquery js έφερε σε μια ετικέτα script ακριβώς πάνω από αυτή τη μέθοδο. Απλά δεν μπορώ να βρώ όλα τα αντικείμενα σε αυτή τη σελίδα με jQuery. Σε άλλες σελίδες, μπορώ.













