< 返回文档列表
2.条件语句[if else]
视频教程:模板下载:

ForeSpider脚本的条件语句是用if开始,有如下三种形式

(1)if(case)


var x = 1;if(x){echo(x);}

(2)if(case)else{}


var x = 1;if(x){echo(x);}else{echo("x is empty");}

(3)if(case){}else if{}else if{}


var x = 1;if(x<0){echo("x < 0");}else if(x>0){echo("x is "+ x);}else{echo("x is empty");}


{}