ajax获取到的id数据,如何通过post方式提交该数据到post页面去。<form id="form1" name="form1" method="post" action="test.php">ajax通过id获取到的值显示:<div id="abc"></div>
  <input type="submit" name="Submit" value="提交" /></form>比如这样子的,如果id=“abc”里面显示的是:我们和你
请问如何才能把我们和你这个值通过post方式提交给test.php处理页面去活得这个值

解决方案 »

  1.   

    百度一下,ajax post请求很多的,我一般都是用jquery的ajax 很方便$.ajax({
                    'type': 'POST',
                    'url':"<?php echo $this->createurl('ctrain')?>",
                    'cache': false,
                    'dataType' :"html",
                    'data':{"id":id},
                    'success': function(data) {
                                            //data是返回的结果
    $("#BgDiv").show();
    $("#show_data").append(data);
                    }
                 });
      

  2.   

    var abc = $("#abc").html();$.post("test.php", { value: abc },
       function(data){
         //do
       });
      

  3.   


    $(function(){        $("#tit").blur(function(){
            
                $.ajax({
                        
                    url:"check.php", 
                    type:"GET", 
                    data:"tit="+$("#tit").val(), 
                    success: function(data)
                    {  
                        $("#chk").html(data); 
                    }
                    
                    });
            })
        
    })我这样子的,如何在test.php页面获得该数据呢。。