第一种方式
function hello(){ var name="he"; var content="<input type=button value='TEST' οnclick='helll(\""+name+"\")' />"; $("#hello").html(content);}function helll(name){ alert(name); this.func=new Function(name+"();"); func();}function he(){ alert("hell");}第二种方式function hello(){ var name="he"; var content="<input type=button value='TEST' οnclick='helll(\""+name+"\")' />"; $("#hello").html(content);}function helll(name){ alert(name); func=function(data){}; this.func = eval(name); func("hel");}function he(name){ alert("hell"+name);}</script>