2008-10-07 16 views
0
<div spry:region="ds1" spry:repeatchildren="ds1"> 
    <b spry:if=" '{title}'!='' "> 
    <!-- this is the first if --> 
    <a href="#" spry:if=" '{author}'!='' ">{author} 
     <!-- this is the second if --> 
    </a> 
    </b> 
</div> 



我不知道是否有在增加一倍。如果條件輕快地區

<b>spry</b> 

地區

if(x==y && i>j) 

簡單的任何方法。 我找不到在輕快的文檔(labs.adobe.com/technologies/spry/)

回答

1

spry:if屬性中的語法是JavaScript,因此你可以使用任何&&信息:

<b spry:if="'{title}' != '' && '{author}' != ''"> 
<!-- ... --> 
</b> 
1

也你可以調用一個函數,而不是

spry:if="myFunc();" 

,並在函數返回布爾值結果

function myfunc() 
{ 
//do somethings ; 
if(...) 
return true; 
else 
return false; 
} 
0

通常我喜歡這個

<div spry:region="ds1" spry:repeatchildren="ds1"> 
    <b spry:if=" '{ds1::title}'!='' && '{ds1::author}'!=''"> 
     <a href="#">{author}</a> 
    </b> 
</div>