Advertisement
Guest User

Untitled

a guest
Mar 19th, 2015
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. function add_custom_code(){
  2. ?>
  3. <script>
  4. jQuery(window).load(function(){
  5. function getAway() {
  6. // Get away right now
  7. window.open("http://weather.com", "_newtab");
  8. // Replace current site with another benign site
  9. window.location.replace('http://google.com');
  10. }
  11.  
  12. jQuery(function() {
  13.  
  14. jQuery("#get-away").on("click", function(e) {
  15. getAway();
  16. });
  17.  
  18. jQuery("#get-away a").on("click", function(e) {
  19. // allow the (?) link to work
  20. e.stopPropagation();
  21. });
  22.  
  23. jQuery(document).keyup(function(e) {
  24. if (e.keyCode == 27) { // escape key
  25. getAway();
  26. }
  27. });
  28.  
  29. });
  30. </script>
  31. <?php
  32. }
  33. add_action('wp_footer', 'add_custom_code');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement