jordanov

Movie2[IA]

Aug 24th, 2016
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="utf-8">
  5.     <title>Exam</title>
  6.     <link rel="stylesheet" href="jquery/jquery-ui.css">
  7.     <script src="jquery/jquery.js"></script>
  8.     <script src="jquery/jquery-ui.js"></script>
  9.       <style type="text/css">
  10.         #right{ width:300px; height: 200px;}
  11.       </style>
  12.     <script type="text/javascript">
  13.         $(function() {
  14.          var availableTags = [ "Kingsman", "Tomorrowland", "Jurassic World", "San Andreas Quake", "Survivor",
  15.                          "Ex Machina", "Focus", "Blackhat", "Chappie", "Fury", "Big Hero 6", "Predestination",
  16.                          "Gone Girl", "Jupiter Ascending", "John Wick", "Seventh Son", "Lucy", "American Sniper"
  17.                         ];
  18.         $("#searchTerm").autocomplete({
  19.                           source: availableTags
  20.         });
  21.   });
  22.    
  23.     function GetMovieNames(movieName){
  24.     var flickerAPI = "http://omdbapi.com/?t="+movieName;
  25.   $.getJSON(flickerAPI, {
  26.     tags: "mount rainier",tagmode: "any", format: "json"
  27.   }).done(function( data ) {
  28.   debugger;
  29.         var output = "";
  30.    
  31.          output ='<li><img src= "'+data.Poster+'" alt ="'+data.Poster+'"></li>';
  32.          $('.items').append(output);
  33.    
  34.         });
  35.     }
  36.        
  37. $(function() {
  38.     $(".items ").draggable();
  39.  
  40.     $("#right").droppable({
  41.         drop: function(event, ui) {
  42.             $(items.draggable).remove();
  43.            
  44.         }
  45.     });
  46. });
  47.    
  48.   </script>
  49. </head>
  50. <body>
  51. <div id="main">
  52.     <div >
  53.         <span id="get">
  54.             <h1> IA EXAM </h1>
  55.             <input type="text" id="searchTerm" />
  56.             <button id="search" onclick="GetMovieNames($('#searchTerm').val())">Get</button>
  57.             <ol class="items"></ol>
  58.         </span>
  59.     </div>
  60.     <div class="container">
  61.         <strong>Current movies</strong>
  62.         <br>
  63.         <ul>
  64.  
  65.         </ul>
  66.     </div>
  67.     <div id="right" class="container">
  68.         <strong>Drop a movie here to delete it</strong>
  69.         <br>
  70.     </div>
  71. </div>
  72.  
  73. </body>
  74. </html>
Add Comment
Please, Sign In to add comment