js中把字符串当做函数运行

2021-08-19
function getWord(Word) {
   alert(Word);
}


window["getWord"]("方法一");
eval('getWord("方法二")');

 

{/if}