ajax success: Function()
<p>I am using this Function:</p>

<pre><code>function ProcessToken(token) {
    $.ajax({
        type: "POST",
        url: "HomePage.aspx/ProcessCard",
        data: '{Token: "' + token + '" }',
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        failure: Failure,            
        success: function(R) {     

            var response = R.d
            alert(response)
            if (response = true) {
                alert("True")
                $form.find('.subscribe').html('Payment successful &lt;i class="fa fa-check"&gt;&lt;/i&gt;');
            } else {
                    alert("False")
                    $form.find('.subscribe').html('Try again').prop('disabled', false);
                    $form.find('.payment-errors').text('Something went wrong, please try again.');
                    $form.find('.payment-errors').closest('.row').show()
            }              

        }

    });

}
</code></pre>

<p>This is what im trying to return</p>

<pre><code>    &lt;WebMethod()&gt; _
Public Shared Function ProcessCard(ByVal Token As String) As Boolean
    Return False
End Function
</code></pre>

<p>I have not been able to get the else statement to occur even though the first alert(response) does show false. The if (response = true) always shows alert("True"). Im not very good at java so not sure how to read the response properly. Ive tried datatype: "text" as well.</p>

<p>Im wanting to make sure true or false is read properly in the if else statement.</p>