$(document).ready(function(){
  submitSearch();
}); 

var submitSearch = function(){
  $("#product-search").on('submit', function(event){
    event.preventDefault();

   var request = $.ajax({
    url:"http://localhost:3000/products/results",
    data: $(this).serialize(), 
    crossDomain: true,
    type:"GET"
   });

   request.done(function(data){
    console.log(data);
    console.log("successssssss");
    $("#product-search").hide();
    $(".search-results").prepend(data);
   });
   request.fail(function(data){
    console.log("fail");
   });
  });
};


@@ -23,16 +23,33 @@
 tion()%7B%0A
+  hardLanding();%0A
   submit
@@ -60,16 +60,197 @@
 ch()
-;
 %0A%7D); %0A%0A
+%0A%0Avar hardLanding = function()%7B%0A  $('a').on('click', function(event)%7B%0A    event.preventDefault();%0A%0A  $('a').remove();%0A  $(%22.search-product-form%22).css(%22display%22, %22block%22);%0A  %7D);%0A%7D;%0A%0A%0A
 var 
@@ -552,26 +552,16 @@
     
-console.log(data);
+debugger
 %0A   
@@ -595,88 +595,302 @@
 %22);%0A
+%0A
     
-$(%22#
+var 
 product
--search%22).hide();%0A    $(%22.search-results%22).prepend(data);
+s = data%5B%22products%22%5D%0A%0A%0A    for(i = 0; i %3C products.length; i++)%7B%0A      $(%22.search-results%22).prepend(%22%3Cdiv class='product'%3E%3Ca href='%22 + products%5Bi%5D.clickUrl + %22'%3E%22 + %22%3Cimg src='%22 + products%5Bi%5D.image.sizes.IPhoneSmall.url + %22' alt='product Image'%3E%22 + %22%3C/a%3E%3C/div%3E%22)%0A    %7D;%0A
 %0A   %7D);%0A
    r
@@ -885,16 +885,17 @@
 %0A   %7D);%0A
+%0A
    reque

modify js file for the api to display newest items