Newbie to javascript/jquery/ajax...
Here is the ajax call:
$.ajax({
type: "POST",
url: "cfc/newsletter.cfc?method=sendResource",
data: $this.serialize(),
success: function(data) {
console.log(data);
if (data.SUCCESS == 'true') {
message.addClass('opened');
text = "Your email has been sent successfully!";
message.html('<div class="alert_box r_corners color_green success"><p>' + text + '</p></div>')
.slideDown()
.delay(4000)
.slideUp(function() {
$(this).html("");
message.removeClass('opened');
})
.prevAll('input[type="email"]').val("");
} else {
in the console, here is what is logged as the data parameter...
<wddxPacket version='1.0'><header/><data><struct><var name='SUCCESS'><string>true</string></var></struct></data></wddxPacket>
So, how do I access the SUCCESS variable so that my else block does not fire?
data.SUCCESS == true
and data.SUCCESS == 'true'
don't work (nor any other thing I have tried).