开发者

jQuery template: Creating a conditional statement with AND operators

开发者 https://www.devze.com 2023-02-17 19:39 出处:网络
This works: <input type=\"checkbox\" {{if (ON) 开发者_StackOverflow}} checked {{/if}} id=\"cbCentral\" />

This works:

<input type="checkbox" {{if (ON) 开发者_StackOverflow}} checked {{/if}} id="cbCentral" />

This doesn't work:

<input type="checkbox" {{if (ON && QC) }} checked {{/if}} id="cbCentral" />

It seems && cannot be used to represent an AND operator. How can I express an AND operator? ON and QC are type boolean.


This should work:

{{if ON && QC}}checked{{/if}}

I threw together a simple test using AND in an {{if}} here: http://jsfiddle.net/Encosia/vNXV5/

0

精彩评论

暂无评论...
验证码 换一张
取 消