Okay, so I have a snippet of code from a website containing a button:
<button type="button"
onclick="laser(); $.post('sheepDB.php', { vic: vic, num: numVics });">
Activate Her Powers!
</button>
However, when I click the button the first time, the first function executes, but if I click it a second time, both the first function AND the Ajax call are executed. How do I get onclick
to execute them sequentially? (laser()
determines the values sent by the Ajax request, so it must be sequential).