方法一:
<script type="text/javascript">
    function getOtherInfo()
    {
    alert("function");
    var other_info="onblur=addElement('Proportion:','form1','text','proportion','y','','y')";
    return other_info;
    }
    </script>
方法二:
function addElement(textnode,parent,element_type,element_name,changeLine,other_info,delete_info)
    {}
在button 的onclick 方法里调用方法二,不过要把方法一的返回值作为参数。 
类似于:
onclick="addElement('File: ','form1','file','file','n','javascript:getOtherInfo()','y')"。
可是这样的参数就会是:“'javascript:getOtherInfo()”而不是"onblur=addElement('Proportion:','form1','text','proportion','y','','y')"

解决方案 »

  1.   

    onclick="addElement('File: ','form1','file','file','n',getOtherInfo(),'y')"
      

  2.   

    onclick="addElement('File: ','form1','file','file','n',getOtherInfo(),'y')"
      

  3.   

    function f1(){
    return 1;
    }function f2(a){
    return a;
    }alert(f2(f1()));
      

  4.   

    以字符串的形式传递吧,如下没有引号的变量,如果不是变量就加引号成字符串
    onclick="addElement(File: ,"+ form1 + "," + file + "," + file "," + n + "," + javascript:getOtherInfo() + ","+ y +")"