Calling ajax request after processing another ajax request

This question already has an answer here:

  • How to manage a redirect request after a jQuery Ajax call 30 answers
  • replace div content using ajax and jquery 4 answers
  • Replace HTML page with contents retrieved via AJAX 7 answers

  • When you use an AJAX request, the browser doesn't automatically redirect you, or display any content that is returned from your request.

    If rates.html is a full HTML page, change your inner callback from

    success: function () {
      alert('Connected')
    },
    

    to this:

    success: function(data) {
      document.body.innerHTML = data;
    },
    

    That takes the response from the server (your python code), and then does something with it (in this case renders it on the browser).

    链接地址: http://www.djcxy.com/p/12474.html

    上一篇: 在Flask中使用redirect()时,HTML将写入控制台

    下一篇: 处理另一个Ajax请求后调用ajax请求