javascript - Uncaught ReferenceError for a defined variable : <p>Relevant Code:</p>

<pre><code>// Flag For Showing/Hiding Start Campaign Button During Alarm
var blnCampaignStatusIsgood = false;

do {
    $.ajax({
        url: "includes/getCampaigns.php,
        dataType: "json",
        cache: false,
        aysnc: false,
        success: function (res) {
            console.log("Loaded campaign info ...includes/getCampaigns.php");

            // Flag To Stop Ajax Calls
            blnCampaignStatusIsgood = true;
        },
        error: function (res) {
            console.log("Error checking for campaign info: " + res);
        }
    });
} while ( blnCampaignStatusIsGood == false );
</code></pre>

<p>When ran, I receive the error: </p>

<blockquote>
  <p>Uncaught ReferenceError: blnCampaignStatusIsGood is not defined</p>
</blockquote>

<p>On the line with the while condition.</p>

<p>I've tried various declarations of the variable name (with and without "var"), making it global at top of script, as well as changing the ajax request to a sync request.</p>

<p>Why is it saying it's undefined when I clearly define it just prior to the do/while loop?</p>
