for (r in resArray) {
      $(".results li").remove();
      var title = resArray[r]._source.title;
      var year = resArray[r]._source.year;
      var typeOfDrawing = resArray[r]._source.typeOfDrawing;
      var code = resArray[r]._source.code;
      var loctn = resArray[r]._source.location;
      var drawerNumber = resArray[r]._source.drawerNumber;
      function getURL() {
            planSearch(title);
      }
       
      items.push('<li class="reslts" onmouseover="getURL()">' + code + " " +   year + " " + loctn + " " + drawerNumber + "<br />" + title + "<br />" + typeOfDrawing + "</a></li>");
      $(".results").append(items);
      }
When I mouseover I get the error saying:
"getURL not defined"
Where am I wrong?
 
    