The best way to check if jQuery is loaded,
if (window.jQuery) { // jQuery is loaded } else { // jQuery is not loaded }
If you checked the use of if(jQuery){} and it is not there, you will receive a control error, as shown below, and it will break the execution of your script . Checking if the window object has a jQuery property, if it does not exist, it simply returns undefined.

source share