I\'m developing JS that is used in a web framework, and is frequently mixed in with other developers\' (often error-prone) jQuery code. Unfortunately errors in their jQuery(docu
Have you attempted wrapping the error-prone commands in try...catch brackets?
$(function(){
try {
noObject.noMethod();
} catch (error) {
// handle error
}
});
$(function(){
try {
alert("Hello World");
} catch (error) {
// handle error
}
});
To avoid potential confusion, $(function(){ ... });
is functionally the same as $(document).ready(function(){ ... });