87,916
社区成员
发帖
与我相关
我的任务
分享
var hello = function () {
alert("hello world");
};
<script type="text/javascript">
//<![CDATA[
function init() {
if(typeof(eval(getString())) == 'function'){//原来的判断语句
eval(getString());
}
};
function hello() {
alert("hello world");
};
function getString(){
return "hello";//获取字符,这里用hello代替
}
//]]>
<script type="text/javascript">
//<![CDATA[
function init(funName) {
if (funName in window) {
alert("存在");
}
else {
alert("不存在");
}
};
function sayHello() {
alert("hello world");
};
init("sayHello");
//]]>