springs @Component注释的默认范围是什么?
如果您根本不定义范围,那么它是应用程序范围的吗?Spring文档没有说明默认范围。
我有一个jQuery插件.我想在我的jQuery插件中添加try catch块以进行异常处理.
我的插件
$(document).ready(function(){
$('.requiredclass').keyup(function() {
$(this).pluginMethod();
});
});
(function($) { //i Want try catch block for this part
// jQuery plugin definition
$.fn.pluginMethod = function(e) {
return this.each(function() {
var $this = $.this;
var som= $this.val();
//My Code goes here
});
};
})(jQuery);
Run Code Online (Sandbox Code Playgroud)
现在,如果我想添加try catch块,那么插件的外观如何?在jquery函数的情况下我们做这样的事情
功能
function myFunction() {
//varible declarations
try {
//Code goes here
}
catch(err) { //We can also throw from try block and catch it here
alert("err");
}
finally {
//code for finally block
} …Run Code Online (Sandbox Code Playgroud)