Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script src="nui://game/ui/jquery.js" type="text/javascript"></script>
- </head>
- <!--
- 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!
- -->
- <body>
- <div id="testing">
- <form id="testing">
- <h1>This is how NUI works!</h1>
- <input type = "submit" value ="Close" />
- </form>
- </div>
- <!--
- Gets and displays the correct page! Duh!
- -->
- <script>
- if(event.data.enable == true) {
- document.body.style.display = "block";
- } else {
- document.body.sytle.display = "none";
- }
- </script>
- <!--
- Sends the data back to the script, cahange to match the div of the form, and the calling resource/event
- -->
- <script>
- $("#testing").submit(function(e) {
- e.preventDefault(); // Prevent form from submitting
- $.post('http://Pullover/testing', JSON.stringify({
- // Match with input id!
- closing: true
- }));
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement