Bugfix newsletter and footer scripts (#18855)
This commit is contained in:
parent
3b3676191b
commit
f74f4cea10
|
|
@ -331,7 +331,7 @@ function initBenchmarkPickers() {
|
|||
function addFooter() {
|
||||
const footerAnchor = $('.footer');
|
||||
|
||||
fetch('../footer.html').then((response) => response.text()).then((text) => {
|
||||
fetch('/footer.html').then((response) => response.text()).then((text) => {
|
||||
const footerContent = $(text);
|
||||
footerAnchor.append(footerContent);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -4,7 +4,11 @@ newsletterFieldPrefix = 'newsletter-'
|
|||
// debug url
|
||||
// const eloquaUrl = 'https://httpbingo.org/post'
|
||||
|
||||
|
||||
const currentPath = window.location.pathname.slice(1).split('/');
|
||||
const newsletterModalPathVersion = (['cn', 'jp'].includes(currentPath[0])) ?
|
||||
`/${currentPath[0]}/${currentPath[1]}` :
|
||||
`/${currentPath[0]}`;
|
||||
const newsletterModalPath = newsletterModalPathVersion + '/_static/html/newsletter.html';
|
||||
|
||||
$(document).ready(function () {
|
||||
const waitForElement = async selector => {
|
||||
|
|
@ -24,7 +28,7 @@ $(document).ready(function () {
|
|||
// });
|
||||
|
||||
function showForm() {
|
||||
fetch('_static/html/newsletter.html').then((response) => response.text()).then((text) => {
|
||||
fetch(newsletterModalPath).then((response) => response.text()).then((text) => {
|
||||
const newsletter = $('<div>');
|
||||
newsletter.attr('id', 'newsletterModal');
|
||||
newsletter.addClass('newsletterContainer');
|
||||
|
|
|
|||
Loading…
Reference in New Issue