【www.bbyears.com--php函数】
代码如下
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
"http://www.w3.org/1999/xhtml"
>
"Content-Type"
content=
"text/html; charset=utf-8"
/>
Test
<script type=
"text/javascript"
language=
"javascript"
>
word">function
showFace(unipcn,value){}
word">var
isFunction =
false
;
try
{
//这里的代码需要用try一下,因为当showFace为定义时会抛出异常
isFunction =
typeof
(eval(
'showFace'
))==
"function"
;
}
catch
(e){}
if
(isFunction) {
alert(
'showFace is a Function!'
);
}
else
{
alert(
'showFace is not a Function!'
);
}
运行效果图如下: