<script>
function post(URL,id) {        
    var temp = document.createElement("form");        
    temp.action = URL;        
    temp.method = "post";  
temp.name="myform";      
    temp.style.display = "none";        
    var input=document.createElement("input");
input.name="catid";     
input.vaule=id; 
    input.style.display = "none"; 
tempform=temp.appendChild(input);
    document.body.appendChild(temp);        
    tempform.submit();        
    return temp;        
}    
</script>哪里错了 很奇怪 提交过后提示错误  tempform.submit is not a function   没有创建成功吗

解决方案 »

  1.   

    这部分已经搞定了 方法如下<script type="text/javascript">
     function post(URL,id) {
        if(!URL||URL=='#')URL="?action=post";  
        var f = document.createElement("form");        
        f.action = URL;        
        f.method = "post";  
        f.name="myform";      
        f.style.cssText='overflow:hidden;width:1px;height:1px;background-color:white;';    
        var input=document.createElement("input");
        input.name="catid";    
        input.vaule=id; 
    alert input.vaule;    f.appendChild(input);    document.body.appendChild(f);        
        f.submit();    
        return false;        
    }    
    </script>但问题依然存在 发现无法把值传过去为什么呢
      

  2.   

    这部分已经搞定了 方法如下<script type="text/javascript">
     function post(URL,id) {
        if(!URL||URL=='#')URL="?action=post";  
        var f = document.createElement("form");        
        f.action = URL;        
        f.method = "post";  
        f.name="myform";      
        f.style.cssText='overflow:hidden;width:1px;height:1px;background-color:white;';    
        var input=document.createElement("input");
        input.name="catid";    
        input.vaule=id; 
    alert input.vaule;    f.appendChild(input);    document.body.appendChild(f);        
        f.submit();    
        return false;        
    }    
    </script>但问题依然存在 发现无法把值传过去为什么呢