Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- (function() {
- function getLbIdentifier() {
- var lbData = null;
- adoric.lightboxes.forEach(function(item) {
- if (item.options.campaignId === self.campaignId) {
- lbData = item;
- }
- });
- return lbData;
- }
- var form = document.querySelector('.' + self.identifier + ' [tabindex] form');
- var allCampaignData = getLbIdentifier();
- form.addEventListener('submit', function() {
- var allFormInputs = form.querySelectorAll('INPUT');
- var formData = {};
- for (var i = 0; i < allFormInputs.length; i++) {
- if (allFormInputs[i].getAttribute('name') !== 'sumbit') {
- fieldName = allFormInputs[i].getAttribute('name');
- fieldValue = allFormInputs[i].value;
- formData[fieldName] = fieldValue;
- console.log(fieldName, '=', fieldValue);
- }
- }
- formData.groupID = '182216';
- var data = {
- subscribe: formData,
- referrer: document.referrer,
- country: sessionStorage.getItem('country_code_cache'),
- action: 'http://www.pulseem.com/Pulseem/PulseemServices.asmx/PostNewClient',
- enctype: '#',
- method: 'GET',
- campaignData: {
- options: {
- id: allCampaignData.id,
- userId: allCampaignData.options.userId,
- domainId: allCampaignData.statistic.domainId,
- accountId: allCampaignData.options.userId,
- campaignTitle: allCampaignData.options.campaignTitle,
- title: allCampaignData.options.title,
- type: allCampaignData.options.type
- }
- }
- };
- var xhr = new XMLHttpRequest();
- xhr.addEventListener('readystatechange', function() {
- if (this.readyState === 4) {
- console.log('response - ', this.responseText);
- }
- });
- xhr.open('POST', 'https://app.adoric-om.com/v1/forms/webhook');
- xhr.setRequestHeader('cache-control', 'no-cache');
- xhr.send(JSON.stringify(data));
- formData.groupID = '467436';
- var data = {
- subscribe: formData,
- referrer: document.referrer,
- country: sessionStorage.getItem('country_code_cache'),
- action: 'http://www.pulseem.com/Pulseem/PulseemServices.asmx/PostNewClient',
- enctype: '#',
- method: 'GET',
- campaignData: {
- options: {
- id: allCampaignData.id,
- userId: allCampaignData.options.userId,
- domainId: allCampaignData.statistic.domainId,
- accountId: allCampaignData.options.userId,
- campaignTitle: allCampaignData.options.campaignTitle,
- title: allCampaignData.options.title,
- type: allCampaignData.options.type
- }
- }
- };
- var xhr = new XMLHttpRequest();
- xhr.addEventListener('readystatechange', function() {
- if (this.readyState === 4) {
- console.log('response - ', this.responseText);
- }
- });
- xhr.open('POST', 'https://app.adoric-om.com/v1/forms/webhook');
- xhr.setRequestHeader('cache-control', 'no-cache');
- xhr.send(JSON.stringify(data));
- });
- })();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement