我正在查看一些jQuery UI代码,在那里发现了一个奇怪的行为:
jQuery.ui||(function(a){ /*... */ })(jQuery);;
逻辑OR对我来说很清楚,函数包装器(仍在为它搜索正确的名称),但为什么是两个分号?
提前致谢
文森特
编辑:刚发现另一个奇怪的事情:version on google apis只有一个分号。但是当您在http://jqueryui.com/download上创建on build时,有两个分号。
答案 0 :(得分:1)
打破它:
// make sure that any previous statements are properly closed
// this is handy when concatenating files, for example
;
// Call the jQuery.ui object, or, if it does not exist, create it
jQuery.ui || (function($) {
答案 1 :(得分:0)
错字?我想不出任何有效的理由。
答案 2 :(得分:0)
这必须是一个错误或误解。两个连续的分号没有意义。