Advertisement
Guest User

Untitled

a guest
Jun 24th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. </head>
  5. <body>
  6. <script src="iframeapi.js"></script>
  7. <script>
  8. // The event emitted when everything is loaded
  9. OSjs.on('init', function() {
  10. console.log(arguments);
  11.  
  12. // Send something
  13. OSjs.send({cool: 'Awesome'});
  14. });
  15.  
  16. // The event emitted when app is closed
  17. OSjs.on('destroy', function() {
  18. });
  19.  
  20.  
  21. // Whenever you get data without `message` parameter
  22. OSjs.on('data', function(data) {
  23. console.log(data.zazz); // === "jazz"
  24. });
  25.  
  26. // Whenever you get data with `message` set
  27. OSjs.on('message:something', function(data) {
  28. console.log(data.bar); // === "baz"
  29. });
  30.  
  31. </script>
  32. </body>
  33. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement