khaliefa2019new

Untitled

Aug 15th, 2025 (edited)
602
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 6.13 KB | Source Code | 0 0
  1. <script>
  2. jQuery(document).ready(function ($) {
  3.     var theURL = '';
  4.     $('.trigger-downloadable-popup').on('click', function (e) {
  5.         e.preventDefault();
  6.         theURL = $(this).attr('data-downloadable_url');
  7.         setTimeout(function () {
  8.             $('#form-field-downloadable_url').val(theURL);
  9.         }, 300);
  10.     });
  11.    
  12.     jQuery( document ).on('submit_success', function(e) {
  13.         var link = document.createElement('a');
  14.         link.href = theURL;
  15.         link.download = theURL;
  16.         link.dispatchEvent(new MouseEvent('click'));
  17.         // console.log('New dataLayer: ', theURL)
  18.         // window.location.href = theURL;
  19.     });
  20.  
  21. });
  22. </script>
  23.  
  24. <script>
  25. jQuery(document).ready(function ($) {
  26.     var theURL = '';
  27.  
  28.     $('.trigger-downloadable-popup').on('click', function (e) {
  29.         e.preventDefault();
  30.         theURL = $(this).attr('data-downloadable_url');
  31.         setTimeout(function () {
  32.             $('#form-field-downloadable_url').val(theURL);
  33.         }, 300);
  34.     });
  35.  
  36.     $(window).on('elementor/popup/show', function (event, id) {
  37.         if (id === 33971) {
  38.             $('#form-field-downloadable_url').val(theURL || '');
  39.         }
  40.     });
  41.    
  42.     jQuery( document ).on('submit_success', function(e) {
  43.         var link = document.createElement('a');
  44.         link.href = theURL;
  45.         link.download = theURL;
  46.         link.dispatchEvent(new MouseEvent('click'));
  47.         // console.log('New dataLayer: ', theURL)
  48.         // window.location.href = theURL;
  49.     });
  50.  
  51.    
  52. });
  53. </script>
  54. <script>
  55. jQuery(document).ready(function ($) {
  56.     var theURL = '';
  57.  
  58.     // Store the URL when the button is clicked
  59.     $('.trigger-downloadable-popup').on('click', function (e) {
  60.         e.preventDefault();
  61.         theURL = $(this).attr('data-downloadable_url');
  62.         setTimeout(function () {
  63.             $('#form-field-downloadable_url').val(theURL);
  64.         }, 300);
  65.     });
  66.  
  67.     // Prefill the field when the popup is opened
  68.     $(window).on('elementor/popup/show', function (event, id) {
  69.         if (id === 33971) {
  70.             $('#form-field-downloadable_url').val(theURL || '');
  71.         }
  72.     });
  73.  
  74.     // Redirect after successful form submission
  75.     $(document).on('elementor/popup/form:success', function (event, id, form) {
  76.         alert("test");
  77.         // Optional: check popup ID if you want to be specific
  78.         console.log("ya raaaaaaaaaaab",theURL);
  79.         if (theURL) {
  80.             window.location.href = theURL;
  81.         }
  82.     });
  83.    
  84.    
  85.         $(document).on('elementor-pro/forms/new', function (event, form) {
  86.             console.log("ya raaaaaaaaaaab",theURL);
  87.            
  88.         form.on('submit_success', function () {
  89.             if (theURL) {
  90.                 window.location.href = theURL;
  91.             }
  92.         });
  93.     });
  94.    
  95.    
  96.     jQuery( document ).on('submit_success', function(e) {
  97.         var link = document.createElement('a');
  98.         link.href = theURL;
  99.         link.download = theURL;
  100.         link.dispatchEvent(new MouseEvent('click'));
  101.         console.log('New dataLayer: ', theURL)
  102.         window.location.href = theURL;
  103.     });
  104.  
  105.    
  106. });
  107. </script>
  108. <script>
  109. jQuery(document).ready(function($) {
  110.     var theURL;
  111.     $('.trigger-downloadable-popup').on('click', function(e) {
  112.         e.preventDefault();
  113.         theURL = $(this).attr('data-downloadable_url');
  114.         console.log(this);
  115.     //  elementorProFrontend.modules.popup.showPopup({ id: 33971 });
  116.         setTimeout(function() { $('#form-field-downloadable_url').val(theURL); }, 300); });
  117.         jQuery(window).on('elementor/popup/show', function(event, id, instance) {
  118.             if (id === 33971) {
  119.                     console.log('Popup opened with ID:', id);
  120.                     console.log(theURL);
  121.                     jQuery('#form-field-downloadable_url').val(theURL);
  122.             }
  123.         });
  124.     });
  125. </script>
  126.  
  127. a[href="#trigger-downloadable-popup"]
  128.  
  129. #trigger-downloadable-popup
  130.  
  131. <script>
  132. jQuery(document).ready(function($) {
  133.     var theURL;
  134.     $('.trigger-downloadable-popup').on('click', function(e) {
  135.         e.preventDefault();
  136.         theURL = $(this).attr('data-downloadable_url');
  137.         console.log(this);
  138.     //  elementorProFrontend.modules.popup.showPopup({ id: 33971 });
  139.         setTimeout(function() { $('#form-field-downloadable_url').val(theURL); }, 300); });
  140.         jQuery(window).on('elementor/popup/show', function(event, id, instance) {
  141.             if (id === 33971) {
  142.                     console.log('Popup opened with ID:', id);
  143.                     console.log(theURL);
  144.                     jQuery('#form-field-downloadable_url').val(theURL);
  145.             }
  146.         });
  147.     });
  148. </script>
  149.  
  150. <script>
  151.     jQuery(document).ready(function ($) {
  152.         $(window).on('elementor/popup/show', function (event, id, instance) {
  153.             if (id === 33971) {
  154.                 setTimeout(function () {
  155.                     $('#form-field-downloadable_url').val('New Value');
  156.                 }, 100);
  157.             }
  158.         });
  159.     });
  160. </script>
  161.  
  162. <script>
  163.     jQuery(document).ready(function ($) {
  164.         var theURL;
  165.         $('.trigger-downloadable-popup').on('click', function (e) {
  166.             e.preventDefault();
  167.             theURL = $(this).attr('data-downloadable_url');
  168.             // console.log(this);
  169.             console.log(theURL);
  170.             setTimeout(function () { $('#form-field-downloadable_url').val(theURL); }, 300);
  171.         });
  172.         jQuery(window).on('elementor/popup/show', function (event, id, instance) {
  173.             if (id === 33971) {
  174.                 jQuery('#form-field-downloadable_url').val(theURL);
  175.             }
  176.         });
  177.     });
  178. </script>
  179.  
  180. <script>
  181.     jQuery(document).ready(function ($) {
  182.         var theURL;
  183.         $('.trigger-downloadable-popup').on('click', function (e) {
  184.             e.preventDefault();
  185.             theURL = $(this).attr('data-downloadable_url');
  186.             // console.log(this);
  187.             console.log(theURL);
  188.             setTimeout(function () { $('#form-field-downloadable_url').val(theURL); }, 300);
  189.         });
  190.         jQuery(window).on('elementor/popup/show', function (event, id, instance) {
  191.             if (id === 33971) {
  192.                 jQuery('#form-field-downloadable_url').val(theURL);
  193.             }
  194.         });
  195.     });
  196. </script>
Advertisement
Add Comment
Please, Sign In to add comment