日期:2014-05-16 浏览次数:20398 次
var result = (username == 'star') ? 'star' : 'moon';
/*判断语句*/ ? /*语句一*/ :/*语句二*/;
(username == 'star') ? document.write("im star") :document.write ("im moon");
/*判断语句*/ ? /*语句块一*/ :/*语句块二*/;
(username == 'star') ? document.write("im star");alert(1) :document.write ("im moon");
(username == 'star') ? (document.write("im star");alert(1)):document.write ("im moon");
(username == 'star') ?eval('document.write("im star");alert(1);'):document.write ("im moon");