I have a javascript function inside which i have two $.post requests.Both the $.post requests should get executed.But sometimes,second $.post request doesn't get executed.What could be the reason for it?
相关问题
- Carriage Return (ASCII chr 13) is missing from tex
- How to fix IE ClearType + jQuery opacity problem i
- jQuery add and remove delay
- Using :remote => true with hover event
- Is there a way to play audio on a mobile browser w
$.post()
is an abbreviated form of the $.ajax() structure. I usually prefer to use the$.ajax()
structure because:asynch: false,
In your case, you might find your problem easier to solve in a
$.ajax()
structure, since it would be easier to see that a second ajax call (that depends on the outcome of a first ajax call) must happen in the success function of the first ajax call.Here is a standalone example (too bad jsFiddle cannot handle ajax...):
TESTER.PHP
yourphpfile.php