开发者

Why does Firebug show duplicate $_POST requests?

I've had this problem for a while: When I use jquery $.post, I see LOTS of requests in the Firebug console that are exactly the same, and only the last one returns anything. If I click on the plus sign to open the tree for any of the other requests, it shifts the console about 1px but is totally blank. The loading images in the console don't go away.

The image shown is the result of a single $.post action in Firebug 1.6.2, Mozilla Firefox 3.6.16 on Windows 7.

Why does Firebug show duplicate $_POST requests?

The action only executes once and returns one result, in other words it behaves normally. Is there an explanation for this, or is something awry with my code?

Even this code will trigger mult开发者_高级运维iple requests in the console:

$('form').submit(function (e) {
    e.preventDefault();
    $.post('/', {}, function(){
        alert('ok');
    }, "json");
});

And the form:

<form method="post" action="/">
<div>
    <input type="hidden" value="1" name="id">
    <button type="submit">Delete</button>
</div>
</form>


That usually means that your client-side code actually is triggering all those individual requests, but only the last one is completing (possibly due to how your server-side handles simultaneous requests from the same session). Can you post the code that's triggering your $.post()?


UPDATE: I checked this out in Firebug Lite on Chrome (no problems), and eventually upgraded to Firefox 4 and Firebug 1.7. No more issues. I "re-google" the subject about once a month to see if it pops up and never once did I hear it reported. So, issue resolved... I guess (Although I miss FF3 already!). I have been dealing with this for at least a year, so I'm still interested in hearing if anyone else has experienced this.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜