Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/90.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript $.get请求中的$.post请求_Javascript_Html_Ajax - Fatal编程技术网

Javascript $.get请求中的$.post请求

Javascript $.get请求中的$.post请求,javascript,html,ajax,Javascript,Html,Ajax,我想得到一个帖子请求的回复,然后在另一个页面上填写我得到的,但我没有工作 我感谢任何帮助或提示,以便更好地思考这个问题 <script type="text/javascript"> $('img').click(function () { alert(this.id); var id = this.id; $.get('testpost.php', null,

我想得到一个帖子请求的回复,然后在另一个页面上填写我得到的,但我没有工作

我感谢任何帮助或提示,以便更好地思考这个问题

<script type="text/javascript">

            $('img').click(function () {
                alert(this.id);
                var id = this.id;

                $.get('testpost.php', null, function (text) {
                    $.post('testcurlserver.php', {'id': id}, function (data) {
                        $(text).find(#containerr).html(data);
                    });
                });
            }); 

$('img')。单击(函数(){
警报(this.id);
var id=this.id;
$.get('testpost.php',null,函数(文本){
$.post('testcurlserver.php',{'id':id},函数(数据){
$(文本).find(#containerr).html(数据);
});
});
}); 
下面是testpost.php

<html>


        <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <body>    



        <script type="text/javascript">

        $.post('testcurlserver.php', {'id': id}, function (data) {

                    $('#content').html(data);
                });


            </script>


        <div id="containerr" style ="border: 1px solid red;">

        </div>
</body>        
</html>

$.post('testcurlserver.php',{'id':id},函数(数据){
$('#content').html(数据);
});

获取调用返回数据了吗?在
$中执行
控制台。记录
。获取
以确保首先有效返回的是什么类型的数据?是JSON还是纯文本?