开发者

Calling function using post inside another jquery post in jquery

开发者 https://www.devze.com 2023-02-23 14:38 出处:网络
I want to callfunction using postinside another jquery post like below, <script type=\"text/javascript\">

I want to call function using post inside another jquery post like below,

<script type="text/javascript">
 $.post("/testcall1",
    function(data){
        $('#testDiv1').html(data);
      $.post('/testcall2',function(data){$('#testDiv2').html(data);});
    });
</script>

From the above piece of code, I have to call one after another not at the same time, Will that work first,开发者_运维知识库 if yes will that work in all kind of browser like IE7, IE8, FF,Safari, Chrome


According to http://api.jquery.com/jQuery.post/, the function will be called when 'success' is returned from the first call, yes it will be called after the first, but only when it is success.. And it should work on all the browsers.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号