2013-06-21 57 views
2
{{if production_country != null || production_year != null}} 
    <h3 class="heading">Details</h3> 
    <p><b>${production_country} ${production_year}</b>, {{html roles}}</p> 
{{/if}} 

如何創建OR語句。這並不在我的jQuery模板工程..Jquery tmpl創建或聲明

+0

我有2個變量的生產年份「和 '生產大國'。當其中一個變量爲空時,我不想在該段落中顯示標題。我如何做到這一點在我的jQuery模板中的if語句?當我使用管道'||'時,它總是顯示錯誤, –

回答

0

相反的:

{{if production_country != null || production_year != null}} 

用途:

{{if production_country !="" OR production_year !=""}} 

我從你的問題不清楚,如果你需要確定production_country和production_year的值。 !如production_year.value = 「」

看到了這個問題:

jQuery: checking if the value of a field is null (empty)