js中函数参数个数有两个,为什么调用时参数是一个或没有都可以调用?
functionSetFolderIcon(iOpen,iClose){varaux;if(!iOpen){iOpen="fopen.gif";iClose="fclos...
function SetFolderIcon(iOpen, iClose)
{
var aux;
if(!iOpen)
{
iOpen = "fopen.gif";
iClose = "fclose.gif";
}
if(!iClose)iClose = iOpen;
aux = new Image();
aux.src= ImgDir + iOpen;
aux = new Image();
aux.src= ImgDir + iClose;
FolderOpenIcon = iOpen;
FolderCloseIcon = iClose;
}
js中就只有这一个函数
调用中
LblTree.Text += "<script language=\"javascript\" type=\"text/jscript\"> \n";
LblTree.Text += "ImgDir = \"leftimage/\";\n";
LblTree.Text += "SetFolderIcon(\"desktop.gif\");";
LblTree.Text += "treeMenuAddItem(0, \" 系统功能操作菜单\");\n";
LblTree.Text += "SetFolderIcon();\n";
为什么调用的是一个参数和无惨的。 展开
{
var aux;
if(!iOpen)
{
iOpen = "fopen.gif";
iClose = "fclose.gif";
}
if(!iClose)iClose = iOpen;
aux = new Image();
aux.src= ImgDir + iOpen;
aux = new Image();
aux.src= ImgDir + iClose;
FolderOpenIcon = iOpen;
FolderCloseIcon = iClose;
}
js中就只有这一个函数
调用中
LblTree.Text += "<script language=\"javascript\" type=\"text/jscript\"> \n";
LblTree.Text += "ImgDir = \"leftimage/\";\n";
LblTree.Text += "SetFolderIcon(\"desktop.gif\");";
LblTree.Text += "treeMenuAddItem(0, \" 系统功能操作菜单\");\n";
LblTree.Text += "SetFolderIcon();\n";
为什么调用的是一个参数和无惨的。 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询