[DOCS] Update newsletter (#18529)
* Change trigger to work from iframe * Add more debug info
This commit is contained in:
9
docs/_static/js/newsletter.js
vendored
9
docs/_static/js/newsletter.js
vendored
@@ -2,7 +2,12 @@ const eloquaUrl = 'https://httpbingo.org/post'
|
||||
|
||||
|
||||
$(document).ready(function () {
|
||||
$('#newsletterTrigger').on('click', showForm);
|
||||
// trigger without iframe
|
||||
// $('#newsletterTrigger').on('click', showForm);
|
||||
|
||||
$('iframe').on('load', function() {
|
||||
$('iframe').contents().find('#newsletterTrigger').on('click', showForm);
|
||||
});
|
||||
|
||||
function showForm() {
|
||||
fetch('_static/html/newsletter.html').then((response) => response.text()).then((text) => {
|
||||
@@ -29,6 +34,8 @@ $(document).ready(function () {
|
||||
// ---------- debug request data
|
||||
// console.log(data);
|
||||
console.log('#############');
|
||||
console.log('Origin: ' + data.headers['Origin'][0]);
|
||||
console.log('Url: ' + data.url);
|
||||
console.log('Form data:');
|
||||
for (key in data.form) {
|
||||
console.log(`-- ${key}: ${data.form[key]}`);
|
||||
|
||||
Reference in New Issue
Block a user