Advertisement
Guest User

ui.js

a guest
May 21st, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.42 KB | None | 0 0
  1. $(function()
  2. {
  3.     window.addEventListener('message', function(event)
  4.     {
  5.         if(event.data.type == "ATMSwitch")
  6.         {
  7.             $('#ATMWindow').css('display', event.data.enable ? 'block' : 'none');
  8.             $('#balance').empty();
  9.             $('#balance').append('Balance: $' + event.data.balance);
  10.         }
  11.     })
  12.    
  13.     $(window).keydown(function(e)
  14.     {
  15.         if(e.which == 8 || e.which == 27)
  16.         {
  17.             $.post('http://atm/close', JSON.stringify({}));
  18.         }
  19.     })
  20. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement