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还是纯文本?