这两个什么意思求详解

function $id(s1, s2) { return s2 ? s1.getElementById(s2) : doc.getElementById(s1); }

 

function iTheme(themeList,themeCss,maxDay){
   if(!$id(themeList)||!$id(themeCss))

}

慕的地6264312
浏览 556回答 6
6回答

largeQ

返回S2,如果为真则s1.getElementById(s2) 否则为doc.getElementById(s1);

慕的地8271018

第一个:如果传了参数s2,就从s1里去获取对ID的元素,否则就从doc里获取 第二个:if(!$id(themeList)||!$id(themeCss)),调用$id,只要能取到themeList或themeCss其中一个都为真。

牧羊人nacy

判断如果s2不存在返回s1.getElementById(s2),反之返回doc.getElementById(s1);

人到中年有点甜

function $id(s1, s2) { return s2 ? s1.getElementById(s2) : doc.getElementById(s1); } 如果只有s1一个参数,直接从 document获得id=s1的节点。 如果有两个参数,从s1获得id=s2的节点,s1是父节点。  
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

SQL Server