I've noticed some bug in window.onload
function. (Maybe it's my wrong)
The problem is when I used following simple function, it worked on all browsers but Chrome.
var name=$("#name");
window.onload = function(){
name.fadeIn(500);
};
Then just for interest, tried this one too:
var name;
window.onload = function(){
name=$("#name");
name.fadeIn(500);
};
In all above cases, Chrome's dev tools gave me this error message:
Uncaught TypeError: Object [object Object] has no method 'fadeIn'
I've resolved this error with following code.
window.onload = function(){
var name=$("#name");
name.fadeIn(500);
};
But now want some explanation, why didn't work first 2 piece of code?
I think that this might be down to a global variable called name. If you call name something different, name1, it works in chrome.http://jsfiddle.net/R2PuZ/1/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With