i have a created object outside the jquery document.ready call and then calling that object methods from inside the document.ready. it works fine on firefox, but giving error in chrome. obviously if i put that object inside the document.ready, it works fine, but then i wont able to call that object from outside the document.ready. so i need solution for this. following is the code
var status = {
method_one: function() { ...},
method_two: function() { ...}
}
jquery(function() { // document ready
status.method_one(); // giving error here in chrome, but does not in firefox.
});
works fine for me in Chrome: http://jsfiddle.net/5s739/
are you setting the
jqueryvalue yourself? Perhaps it should bejQuerywith a capital Q?you can probably test this quickly by checking if
$ == jqueryorjQuery == jqueryunless you’re assigning this yourself.