Advertisement
Guest User

kendricklamar

a guest
Dec 19th, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>jQuery UI Autocomplete - Default functionality</title>
  6. <link rel="stylesheet" href="./jquery-ui-1.11.2.custom/jquery-ui.min.css">
  7. <script src="./jquery-ui-1.11.2.custom/external/jquery/jquery.js"></script>
  8. <script src="./jquery-ui-1.11.2.custom/jquery-ui.min.js"></script>
  9.  
  10. <script>
  11. var urlsrc = "http://yugiohprices.com/api/card_data/";
  12. $(function() {
  13. $("#tags").autocomplete({
  14. delay: 500,
  15. minLength: 3,
  16. source: function(request, response) {
  17. var url = urlsrc + escape(request.term);
  18. $.getJSON("http://query.yahooapis.com/v1/public/yql", {
  19. q: "select * from json where url=\"" + url + "\"",
  20. format: "json"
  21. }, function(data) {
  22. console.log(JSON.stringify(data));
  23. response(data.query.results.json);
  24. })
  25. }
  26. });
  27. });
  28. </script>
  29. </head>
  30. <body>
  31.  
  32. <div class="ui-widget">
  33. <label for="tags">Tags: </label>
  34. <input id="tags">
  35. </div>
  36.  
  37.  
  38. </body>
  39. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement