Portugal | International | Economy | Sport | Life
| “;
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 (“thank you”))
{
var email = document.getElementById (“email”);
var suText = document.getElementById (“StartupText”);
if (email & amp; & amp; suText)
{
email.style.display = “none”;
suText.style.display = “none”;
}
}
}
}
xmlhttp.send (null);
}
}
function empty ()
{}
NClickText function (obj)
{
// var imageInicio = document.getElementById (“imgInicio”);
//imageInicio.style.display = “none”;
if (obj) {
if (obj.Value == obj.title) obj.Value = “”;
obj.focus ();
obj.select ();
}
}
SubmitNewsletters function ()
{
var email = document.getElementById (“email”);
if (email)
{
if (email.value == “”)
{
$ (“#messages”) Html (“Please enter the email.”) Show ()..;
email.focus ();
email.select ();
}
else if (validateForm (email))
{
$ .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 ()..; $ (“#legal”) Hide ().; $ (“.divEmail”) Hide ().; $ (“#a_submit”) 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 (); $ (“#legal”) Hide ().; $ (“.divEmail”) Hide ().; $ (“#a_submit”) 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 (‘@’); dotpos x.lastIndexOf var = (“.”); 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