[英]Semicolon on jQuery
以下jQuery在函數之后使用或不使用分號。 為什么?
jQuery(document).ready(function(){
jQuery("#red").treeview({
animated: "fast",
collapsed: true,
control: "#treecontrol",
persist: "cookie"
})
});
它適用於所有瀏覽器。 這不會導致錯誤嗎?
JavaScript實際上不需要分號。 那只是慣例。
http://inimino.org/~inimino/blog/javascript_semicolons
我建議使用分號,就像我建議縮進你的代碼一樣。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.