“;
xmlhttp.open ( “GET”, fragment_url);
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 & amp; & amp; xmlhttp.status == 200) {
var = strResponse xmlhttp.responseText;
element.innerHTML = strResponse;
if (strResponse.match ( “thanks”))
{
var email = document.getElementById ( “email”);
suText var = document.getElementById ( “StartupText”);
if (email & amp; & amp; suText)
{
email.style.display = “none”;
suText.style.display = “none”;
}
}
}
}
xmlhttp.send (null);
}
}
function empty ()
{}
NClickText function (obj)
{
if (obj) {
if (obj.Value == obj.title) obj.Value = “”;
obj.focus ();
obj.select ();
$ ( “#messages”) Hide ().;
}
}
SubmitNewsletters function ()
{
var email = document.getElementById ( “email”);
if (email & amp; & amp; email.value = “Your email”!)
{
if (email.value == “”)
{
$ ( “#messages”) Html ( “Please enter the email.”) Show ()..;
email.focus ();
email.select ();
}
else if (validateForm (e))
{
$ .ajax ({
type: “POST”
cache: false,
async: true,
dataType: “json”
timeout: 5000,
url: “/Common/Services/service_newsletter.aspx?email=” + escape (email.value)
success: function (data) {
var = json_string JSON.stringify (data);
if (json_string.indexOf ( “addSubscriber”) & gt; -1)
{
if (data.Egoi_Api.addSubscriber.status == “success”)
{
$ ( “#divResponse”) Html ( “Thank you for your registration
You will receive an email with instructions to complete the subscription.”). Show ()..; $ ( “.divEmail”) Hide ().; $ ( “.link_subscreve”) Hide ().; $ ( “#messages”) Hide ().; } Else {$ ( “#messages”) html (data.Egoi_Api.addSubscriber.ERROR) .show ().; }} Else {if (data.Egoi_Api.editSubscriber.status == “success”) {$ ( “#divResponse”). Html ( “Thank you for your registration.
You will receive an email with instructions to complete the .. subscription “) show (); $ ( “.divEmail”) Hide ().; $ ( “.link_subscreve”) Hide ().; $ ( “#messages”) Hide ().; } Else {$ ( “#messages”) html (data.Egoi_Api.editSubscriber.ERROR) .show ().; }}}, Error: function (data) {}}); }} Else {$ ( “#messages”) html ( “Please enter the email.”) Show ()..; }} Function validateForm (e) {var x = email.value; var = ATPOS x.indexOf ( “@”); var dotpos = x.lastIndexOf ( “.”); if (ATPOS = x.length) {$ ( “#messages”) html ( “The entered email is not valid.”) show ()..; email.value = “”; email.focus (); email.select (); return false; } Else return true; }
No comments:
Post a Comment