Advertisement
Guest User

Untitled

a guest
Mar 1st, 2018
625
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. <html>
  2. <head>
  3. <script src="nui://game/ui/jquery.js" type="text/javascript"></script>
  4. </head>
  5. <!--
  6. I don't ususally comment files, but as I work with javascript and html a lot less than I use to, I feel like I should remind myself what does what! Yes this will be used as a template for all my future UI needs! Don't judge me!
  7. -->
  8. <body>
  9. <div id="testing">
  10. <form id="testing">
  11. <h1>This is how NUI works!</h1>
  12. <input type = "submit" value ="Close" />
  13. </form>
  14. </div>
  15.  
  16. <!--
  17. Gets and displays the correct page! Duh!
  18. -->
  19. <script>
  20.  
  21. if(event.data.enable == true) {
  22. document.body.style.display = "block";
  23. } else {
  24. document.body.sytle.display = "none";
  25. }
  26. </script>
  27.  
  28. <!--
  29. Sends the data back to the script, cahange to match the div of the form, and the calling resource/event
  30. -->
  31. <script>
  32. $("#testing").submit(function(e) {
  33. e.preventDefault(); // Prevent form from submitting
  34.  
  35. $.post('http://Pullover/testing', JSON.stringify({
  36. // Match with input id!
  37. closing: true
  38. }));
  39. });
  40. </script>
  41. </body>
  42. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement