我一直在尝试简单地生成一个介于1和5(包括1和5)之间的随机整数。如何使用SSJS做到这一点?
<xp:text escape="true" id="computedField1">
<xp:this.value><![CDATA[#{javascript:return (Math.floor(Math.random()*5)+1)
}]]></xp:this.value>
</xp:text>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句