СКРИПТ ПЕРЕДАЧИ GET и POST ЗАПРОСОВ ###############
1. Шаблон скрипта который вставляется в форму сайта.
СКРИПТ ПЕРЕДАЧИ GET и POST ЗАПРОСОВ ###############
Переходим в редактор страницы. Далее, переходим к форме и ее настройкам (наведите мышкой на форму, появится иконка гаечного ключа справа в рамке формы).
В настройках во вкладке "Форма" находим графу "Действие после отправки". Выбираем "Сообщение + Вставка HTML кода".
Ниже увидите последнее поле "Код для вставки". В это поле вставьте код
<script>
function createIframe(name, src, debug) {
src = src || 'javascript:false';
var tmpElem = document.createElement('div');
tmpElem.innerHTML = '<iframe name="' + name + '" id="' + name + '" src="' + src + '">';
var iframe = tmpElem.firstChild;
if (!debug) {
iframe.style.display = 'none';
}
document.body.appendChild(iframe);
return iframe;
}
function postToIframe(url, data, target) {
var phonyForm = document.getElementById('phonyForm');
if (!phonyForm) {
phonyForm = document.createElement("form");
phonyForm.id = 'phonyForm';
phonyForm.style.display = "none";
phonyForm.method = "POST";
document.body.appendChild(phonyForm);
}
phonyForm.action = url;
phonyForm.target = target;
var html = [];
for (var key in data) {
var value = String(data[key]).replace(/"/g, "\"");
html.push("<input type='hidden' name=\"" + key + "\" value=\"" + value + "\">");
}
phonyForm.innerHTML = html.join('');
phonyForm.submit();
}
createIframe("frame1", "", 0);
postToIframe("http://ДОМЕН_СЕРВИСА_С_ПАРАМЕТРАМИ_GET_ЗАПРОСА",{name:"<%= name %>",phone:"<%= phone %>"},"frame1");
</script>
Вместо ДОМЕН_СЕРВИСА_С_ПАРАМЕТРАМИ_GET_ЗАПРОСА вставляем ссылку вашего сервиса.
Если требуется передача GET запроса, то в ссылке указываем параметры для передачи. Например, saitru.ru/?параметр=значение&параметр=значение
Далее, вместо {name:"<%= name %>",phone:"<%= phone %>"} вставляем свои параметры для передачи их через POST
В данном примере name передает значение из формы имени, а phone - значение из формы телефона.
2. Адрес где находятся инструкции нашей СРМ
https://developers.pipedrive.com/v1
Вот что получается у меня:
<script>
function createIframe(name, src, debug) {
src = src || 'javascript:false';
var tmpElem = document.createElement('div');
tmpElem.innerHTML = '<iframe name="' + name + '" id="' + name + '" src="' + src + '">';
var iframe = tmpElem.firstChild;
if (!debug) {
iframe.style.display = 'none';
}
document.body.appendChild(iframe);
return iframe;
}
function postToIframe(url, data, target) {
var phonyForm = document.getElementById('phonyForm');
if (!phonyForm) {
phonyForm = document.createElement("form");
phonyForm.id = 'phonyForm';
phonyForm.style.display = "none";
phonyForm.method = "POST";
document.body.appendChild(phonyForm);
}
phonyForm.action = url;
phonyForm.target = target;
var html = [];
for (var key in data) {
var value = String(data[key]).replace(/"/g, "\"");
html.push("<input type='hidden' name=\"" + key + "\" value=\"" + value + "\">");
}
phonyForm.innerHTML = html.join('');
phonyForm.submit();
}
createIframe("frame1", "", 0);
postToIframe("http://api.pipedrive.com/v1/deals?api_token=МОЙ КЛЮЧ",{
"name": "<%= phone %>", (Сделка будет называться именем телефона) Так как на сайте нет формы имя
"email": [
{
"value": "<%= email%>",
"primary": true
}
],
"phone": [
{
"value": "<%= phone %>",
"primary": true
},"frame1");
</script>
Мой скайп iimichaelii
Current freelance projects in the category Content Management Systems
Website auditTask for technical debugging of OpenCart 3 (ocStore). I need a fixed budget for the result, not hourly payment. List of tasks 1. Fixing 500 error: A conflict occurs when updating modifiers (likely between system/seo_package.ocmod.xml and unixml.ocmod.xml). It is necessary to… Content Management Systems, PHP ∙ 16 hours 14 minutes back ∙ 34 proposals |
I am looking for a WordPress/Elementor/Woo specialist who has extensive experience with the Woodmart template.
113 USD
It is necessary to update the visual design and structure of the online store for dental products (link will be sent in a private message). The site operates on the WordPress + WooCommerce framework. The template is Woodmart. Tasks: Update the header, footer, and content on… Content Management Systems, HTML & CSS ∙ 16 hours 23 minutes back ∙ 29 proposals |
No applications are coming to TG ocStore (OpenCart)Requests from the online store to Telegram have stopped coming. There are 5 websites hosted on the same server, the version of the engine and modules is the same, but a few weeks ago, requests stopped coming to TG from all sites (the TG bots and groups are different). Requests… Content Management Systems, Web Programming ∙ 18 hours 6 minutes back ∙ 60 proposals |
A WordPress site using the Kadence theme and Kadence Blocks.
225 USD
We need to create a website on WordPress using the Kadence theme and Kadence Blocks. There will be no online store (although it may be added in the future). We need a homepage and several internal pages. The graphics are already prepared, the layout structure is mostly defined,… Content Management Systems, PHP ∙ 21 hours 8 minutes back ∙ 34 proposals |
Integration of HubSpot with lead generation sources (Perspective, WordPress, Meta Ads)
90 USD
Good day! Project goal: To build end-to-end automation for lead collection from a multi-platform ecosystem into HubSpot CRM. It is necessary to ensure the creation/updating of contacts and the automatic opening of deals while preserving the full attribution chain of traffic… Content Management Systems, Data Processing ∙ 22 hours 3 minutes back ∙ 16 proposals |