jQuery Templates, Test for Undefined JSON Variable

I needed to test for an undefined JSON variable today. It’s pretty simple.

{{if ImageUrl }}
<img src="${ImageUrl}" alt="${ImageAltText}" title="${ImageTitle}" />
{{/if}}

I found the answer in the comments on the jQuery template {{if}} tag page: http://api.jquery.com/template-tag-if/

Posted in: Development  |  Tagged with: ,  |  Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

*