﻿function RegisterSubscription() {
    var emailAddress = $("#txtEmail").val();

    $.ajax({
        type: "POST",
        url: "/Services/SubscriptionService.asmx/RegisterSubscription",
        data: "{'emailAddress':'" + emailAddress + "'}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (response) {
            if (response.d.Success) {
                alert("Thank you for subscribing.");
            }
            else {
                alert(response.d.Message);
            }
        },
        failure: function (msg) {
            alert("An error has occurred.");
        }
    });
}

