Advertisement
the0938

Untitled

Feb 3rd, 2021
682
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3.             window.DzpCalculator = {};
  4.             window.DzpCalculator.withControlsShadow = true;
  5.             window.DzpCalculatorWide = {};
  6.  
  7.             var script = document.createElement('script');
  8.  
  9.             script.setAttribute('async', true);
  10.  
  11.             function createCalc() {
  12.               if (window.innerWidth < 960) {
  13.                 script.setAttribute('src', 'https://dozarplati.com/js/calculatorWidget.js?ver=3');
  14.  
  15.                 window.DzpCalculator.onload = function () {
  16.                   window.DzpCalculator.render("single-calc");
  17.                 }
  18.               } else {
  19.  
  20.                 script.setAttribute('src', 'https://my.dozarplati.com/widgets/calculator.js?ver=3');
  21.  
  22.                 window.DzpCalculatorWide.onload = function () {
  23.                   window.DzpCalculatorWide.render("single-calc");
  24.                 }
  25.  
  26.                 var calculatorStyles = document.createElement('link');
  27.                 calculatorStyles.rel = 'stylesheet';
  28.                 calculatorStyles.type = 'text/css';
  29.                 calculatorStyles.href = '//my.dozarplati.com/css/calculatorWidget.css';
  30.                 document.head.appendChild(calculatorStyles);
  31.               }
  32.             };
  33.  
  34.             createCalc();
  35.  
  36.             document.body.appendChild(script);
  37.  
  38.        
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement