Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. <?php wp_footer(); ?>
  2. <script type="text/javascript">
  3. (function () {
  4.  
  5. function getCookie(cname) {
  6. var name = cname + "=";
  7. var decodedCookie = decodeURIComponent(document.cookie);
  8. var ca = decodedCookie.split(';');
  9. for(var i = 0; i <ca.length; i++) {
  10. var c = ca[i];
  11. while (c.charAt(0) == ' ') {
  12. c = c.substring(1);
  13. }
  14. if (c.indexOf(name) == 0) {
  15. return c.substring(name.length, c.length);
  16. }
  17. }
  18. return "";
  19. }
  20.  
  21. var cookie = getCookie('mcdpf_search_data');
  22.  
  23. if (cookie != '') {
  24. cookie = JSON.parse(cookie);
  25. var search = document.getElementById('parkos-search');
  26. if (search != null){
  27. search.dataset.arrival = cookie['sd'];
  28. search.dataset.departure = cookie['ed'];
  29. }
  30. }
  31. }());
  32. </script>
  33. <div id="parkos-widget-root"></div>
  34. <script type="text/javascript">
  35. (function () {
  36. var e = document.createElement('script');
  37. e.async = true;
  38. e.src = 'https://parkos.nl/widget/widget.js';
  39. document.getElementById('parkos-widget-root').appendChild(e);
  40. }());
  41. </script>
  42. </body>
  43. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement