Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- jQuery(document).ready(function ($) {
- var theURL = '';
- $('.trigger-downloadable-popup').on('click', function (e) {
- e.preventDefault();
- theURL = $(this).attr('data-downloadable_url');
- setTimeout(function () {
- $('#form-field-downloadable_url').val(theURL);
- }, 300);
- });
- jQuery( document ).on('submit_success', function(e) {
- var link = document.createElement('a');
- link.href = theURL;
- link.download = theURL;
- link.dispatchEvent(new MouseEvent('click'));
- // console.log('New dataLayer: ', theURL)
- // window.location.href = theURL;
- });
- });
- </script>
- <script>
- jQuery(document).ready(function ($) {
- var theURL = '';
- $('.trigger-downloadable-popup').on('click', function (e) {
- e.preventDefault();
- theURL = $(this).attr('data-downloadable_url');
- setTimeout(function () {
- $('#form-field-downloadable_url').val(theURL);
- }, 300);
- });
- $(window).on('elementor/popup/show', function (event, id) {
- if (id === 33971) {
- $('#form-field-downloadable_url').val(theURL || '');
- }
- });
- jQuery( document ).on('submit_success', function(e) {
- var link = document.createElement('a');
- link.href = theURL;
- link.download = theURL;
- link.dispatchEvent(new MouseEvent('click'));
- // console.log('New dataLayer: ', theURL)
- // window.location.href = theURL;
- });
- });
- </script>
- <script>
- jQuery(document).ready(function ($) {
- var theURL = '';
- // Store the URL when the button is clicked
- $('.trigger-downloadable-popup').on('click', function (e) {
- e.preventDefault();
- theURL = $(this).attr('data-downloadable_url');
- setTimeout(function () {
- $('#form-field-downloadable_url').val(theURL);
- }, 300);
- });
- // Prefill the field when the popup is opened
- $(window).on('elementor/popup/show', function (event, id) {
- if (id === 33971) {
- $('#form-field-downloadable_url').val(theURL || '');
- }
- });
- // Redirect after successful form submission
- $(document).on('elementor/popup/form:success', function (event, id, form) {
- alert("test");
- // Optional: check popup ID if you want to be specific
- console.log("ya raaaaaaaaaaab",theURL);
- if (theURL) {
- window.location.href = theURL;
- }
- });
- $(document).on('elementor-pro/forms/new', function (event, form) {
- console.log("ya raaaaaaaaaaab",theURL);
- form.on('submit_success', function () {
- if (theURL) {
- window.location.href = theURL;
- }
- });
- });
- jQuery( document ).on('submit_success', function(e) {
- var link = document.createElement('a');
- link.href = theURL;
- link.download = theURL;
- link.dispatchEvent(new MouseEvent('click'));
- console.log('New dataLayer: ', theURL)
- window.location.href = theURL;
- });
- });
- </script>
- <script>
- jQuery(document).ready(function($) {
- var theURL;
- $('.trigger-downloadable-popup').on('click', function(e) {
- e.preventDefault();
- theURL = $(this).attr('data-downloadable_url');
- console.log(this);
- // elementorProFrontend.modules.popup.showPopup({ id: 33971 });
- setTimeout(function() { $('#form-field-downloadable_url').val(theURL); }, 300); });
- jQuery(window).on('elementor/popup/show', function(event, id, instance) {
- if (id === 33971) {
- console.log('Popup opened with ID:', id);
- console.log(theURL);
- jQuery('#form-field-downloadable_url').val(theURL);
- }
- });
- });
- </script>
- a[href="#trigger-downloadable-popup"]
- #trigger-downloadable-popup
- <script>
- jQuery(document).ready(function($) {
- var theURL;
- $('.trigger-downloadable-popup').on('click', function(e) {
- e.preventDefault();
- theURL = $(this).attr('data-downloadable_url');
- console.log(this);
- // elementorProFrontend.modules.popup.showPopup({ id: 33971 });
- setTimeout(function() { $('#form-field-downloadable_url').val(theURL); }, 300); });
- jQuery(window).on('elementor/popup/show', function(event, id, instance) {
- if (id === 33971) {
- console.log('Popup opened with ID:', id);
- console.log(theURL);
- jQuery('#form-field-downloadable_url').val(theURL);
- }
- });
- });
- </script>
- <script>
- jQuery(document).ready(function ($) {
- $(window).on('elementor/popup/show', function (event, id, instance) {
- if (id === 33971) {
- setTimeout(function () {
- $('#form-field-downloadable_url').val('New Value');
- }, 100);
- }
- });
- });
- </script>
- <script>
- jQuery(document).ready(function ($) {
- var theURL;
- $('.trigger-downloadable-popup').on('click', function (e) {
- e.preventDefault();
- theURL = $(this).attr('data-downloadable_url');
- // console.log(this);
- console.log(theURL);
- setTimeout(function () { $('#form-field-downloadable_url').val(theURL); }, 300);
- });
- jQuery(window).on('elementor/popup/show', function (event, id, instance) {
- if (id === 33971) {
- jQuery('#form-field-downloadable_url').val(theURL);
- }
- });
- });
- </script>
- <script>
- jQuery(document).ready(function ($) {
- var theURL;
- $('.trigger-downloadable-popup').on('click', function (e) {
- e.preventDefault();
- theURL = $(this).attr('data-downloadable_url');
- // console.log(this);
- console.log(theURL);
- setTimeout(function () { $('#form-field-downloadable_url').val(theURL); }, 300);
- });
- jQuery(window).on('elementor/popup/show', function (event, id, instance) {
- if (id === 33971) {
- jQuery('#form-field-downloadable_url').val(theURL);
- }
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment