astroport/www/LOVELand/ajaxform.js

41 lines
2.0 KiB
JavaScript
Raw Normal View History

2020-04-14 02:26:37 +02:00
jQuery(document).ready(function () {
2020-05-14 02:41:09 +02:00
var host = window.location.hostname;
$('#nodename').html(host);
2020-05-14 11:51:25 +02:00
2020-04-14 02:26:37 +02:00
$("#formphone").submit(function(e) {
e.preventDefault(); // avoid to execute the actual submit of the form.
console.log("button PHONE clicked");
$("#phoneresultat").html("<p><h3>ensuite patiente un peu... ce monde est Zen.<h3>" +
"<h5>Tu recevras une clef pour te libérer des services privés du vieux monde.</h5></p>" +
2020-06-03 19:17:50 +02:00
"<script type='text/javascript'>var _mtm = _mtm || []; _mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src='https://piwik.p2p.legal/js/container_XDhfGZPj.js'; s.parentNode.insertBefore(g,s); </script>");
2020-04-14 02:26:37 +02:00
// declare these vars
var phone = jQuery("#phone");
2020-05-13 22:58:10 +02:00
var parrain = jQuery("#parrain");
var naissance = jQuery("#naissance");
2020-04-14 02:26:37 +02:00
var data = '';
2020-05-23 05:02:11 +02:00
// ajax call to ajax.php
jQuery.getJSON("http://"+host+":10099/sms_loveland.php", {
2020-05-13 22:58:10 +02:00
phone: phone.val(), parrain: parrain.val(), naissance: naissance.val()
2020-04-14 02:26:37 +02:00
}, function (data) {
2020-05-13 13:03:56 +02:00
$("#phoneresultat").html("<p>Votre inscription en prise en compte...</p>");
2020-04-14 02:26:37 +02:00
});
});
$("#formemail").submit(function(e) {
e.preventDefault(); // avoid to execute the actual submit of the form.
console.log("button EMAIL clicked");
$("#emailresultat").html("<p><h3>MERCI, vous allez recevoir plus de détails dans votre boite Email</h3></p>");
// declare these vars
var email = jQuery("#email");
var data = '';
// ajax call to ajax.php
jQuery.getJSON("ajax.php", {
email: email.val()
}, function (data) {
$("#emailresultat").html("<p>MERCI, Nous vous envoyons le détail de l'offre Made In Zion / Bank par Email</p>");
});
});
2020-05-04 02:10:46 +02:00
});