How to check if jQuery library is loaded?
To check if jQuery library is loaded, use the following JavaScript code :
if (typeof jQuery != 'undefined') {
alert("jQuery library is loaded!");
}else{
alert("jQuery library is not found!");
}
Alternative?
In some blogs and forum mention about the following alternative code :
if (jQuery) {
alert("jQuery library is loaded!");
} else {
alert("jQuery library is not found!");
}
However, this is not working, when the jQuery library is not loaded, this code will failed (jQuery is not define), and the alert message will never execute.
At last, the first jQuery checking method is always recommended.
!!window.jQuery works also in the console- evaluates true it is loaded.
That was GOLDEN. Saved me many pulled hairs.
This will also help you.
DOM Load
How to access parent jsp’s(the main jsp page) elements in the child jsp(the jsp page which is called from main jsp using object tag in html) in IE8?
And,in the dashboard jsp page,I am doing ,
This is working prefectly in chrome ,but not in IE8.When i tested it, it shows undefined for that div in dashboard page in IE8 after the dashboard page is rendered.And in chrome it’s showing correct value.
Please help me with it.
Thanks!
is not working ,although jquery is working !