$(document).ready(function(){ var bcount = 0; if (bcount !== 0) { // 如果 $bcount 不等于 0 $("span.num-sub").text(bcount); // 将 $bcount 的值输出到 标签中 } });