Advertisement
Guest User

Untitled

a guest
Jul 26th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>phonechange</title>
  6. </head>
  7. <body>
  8.  
  9. <div class="tel ptsans">
  10. <div class="phones" id="phone">
  11. <span class="code">(029)</span>
  12. <span class="number">308-06-20<span>
  13. </div>
  14. <div class="phones" id="phone1">
  15. <span class="code">(017)</span>
  16. <span class="number">267-88-66</span></span>
  17. </div>
  18. </div>
  19. <script>
  20. (function(d) {
  21.  
  22. window.addEventListener('DOMContentLoaded', function() {
  23. init('#phone','+375 (29)', '657-44-94');
  24. init('#phone1','', '');
  25. });
  26.  
  27. function init(id, code, tel) {
  28.  
  29. var r = d.referrer;
  30. var str = r.toString();
  31. var phone = d.querySelector(id);
  32.  
  33. console.log(r.match('bosch-kotly.by') !== null)
  34. console.log(localStorage.getItem('bosch') !== null)
  35.  
  36. if (r.match('bosch-kotly.by') === null && localStorage.getItem('bosch') === null) return;
  37.  
  38. phone.querySelector('.code').innerHTML = code;
  39. phone.querySelector('.number').innerHTML = tel;
  40.  
  41. localStorage.setItem('bosch', true);
  42.  
  43. }
  44.  
  45. }(document));
  46. </script>
  47. </body>
  48. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement