【问题标题】:Is it possible to write new ajax in jquery ajax success method?是否可以在 jquery ajax 成功方法中编写新的 ajax?
【发布时间】:2022-06-15 20:47:55
【问题描述】:

我正在使用 jquery ajax 发出请求。如果请求结果成功,我想写一个新的ajax。我可以在success方法里面写如下吗?还是我需要用其他方法调用它?

         $.ajax({
            type: 'get',
            url: "...",
            data: {...},
            headers: {...},
            success: function(data) {
                if (data.status == 'Success') {
                   $.ajax({???});               

                }
            },
            error: function(data) {
                ...
            },
        });

【问题讨论】:

  • 你试过了吗?在那次尝试中什么没有按预期工作?
  • 我不明白为什么不这样做,但为什么你不能发出一个请求来返回你需要的所有数据?
  • 你不见了dataType: "json",

标签: jquery ajax


猜你喜欢
  • 2011-12-29
  • 1970-01-01
  • 2012-03-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-10-08
  • 1970-01-01
相关资源
最近更新 更多