如何在jQuery中使用注释 ,使用自动化插件您的意见和不用其他floading意见有效地使用它们有效地发表意见。
基本jQuery的意见
jQuery的意见,发起了告诉解释就行了下面的文字是不是要处理,如JavaScript双斜杠。 jQuery的评论可以是一个函数内部或外部没有区别。
function myFunction ( myVar, myVar2 ) {
// Pay attention to spaces around
// the brackets and curly brackets
}
// some prefere it like this
function myFunction()
{
...
}
多行jQuery的意见
Multi-line jQuery comments are enclosed within a combination of a forward slash and an asterisk like so:/* comment */
jQuery Commenting Guidelines
Here are a couple of pointers for commenting in jQuery:
- Long comments should use /* ... */.
- Single line comments should always be on their own line and be
above the line they reference. Additionally there should be an
extra endline above it. For example:var some = "stuff"; // We're going to loop here for ( var i = 0; i < 10; i++ ) {} [/js]
Source: http://docs.jquery.com/JQuery_Core_Style_Guidelines