Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>AJAXjSON</title>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
- </head>
- <script>
- function myFunction()
- {
- $.ajax({
- url: "http://155.158.112.252/ajax/rand.php",
- dataType: "jsonp"
- }).done(function(data) {
- document.body.innerHTML += data;
- console.log(data);
- });
- }
- </script
- <body>
- <button type="button" onclick="myFunction()">Try it</button>
- <div id="wynik">Wynik zapytania: </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement