views:

684

answers:

2

Hello, I'm trying to use document.ready in IE 8 and I keep getting an error that "The object does not support this property" when I load the page. I at the point where I'm simply trying to display an alert using document.read. Here is the code I'm using:

In the Head tag I load the jquery file

in the script tag, that is located just before the body closing tag I have the following:

alert("typeof $: " + typeof $);
$(document).ready(function () { alert("Number One"); });

THe first alert tells me that $ is a function. Then the error occurs once the browswer hits the document.ready line......

Does anyone have any ideas. I'm hoping to load a script that will allow for the selecting and deselecting of check boxes in unique columns in a gridview.

Terry

+1  A: 

Are you using any other libraries that might conflict?

What does this do?

jQuery(document).ready(function() {
  alert("Number One");
});
cletus
+2  A: 

Is it possible that another JavaScript library, loaded before JQuery, is using the $ function for itself? Take a look at jQuery.noConflict();.

matt b
Good call! I make this a practice whether or not I initially have other libraries and on top of that I tend to call jQuery directly rather than the $ alias. This helps prevent issues in the future.
Fooberichu