Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <script src="https://code.jquery.com/jquery-latest.min.js"></script>
- <script>
- /**
- * Gets a quote via JSON.
- */
- function quote()
- {
- var url = '/quote?symbol=' + $('#symbol').val();
- $.getJSON(url, function(data) {
- alert(data.price);
- });
- }
- </script>
- <title>ajax0</title>
- </head>
- <body>
- <form onsubmit="quote(); return false;">
- <input autocomplete="off" autofocus id="symbol" placeholder="Symbol" type="text"/>
- <input type="submit" value="Get Quote"/>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement