Permalink
Browse files

Clean up for jsonp usage

  • Loading branch information...
chriswk committed Mar 30, 2012
1 parent a0bd909 commit 2032a5f2a9a12f02e7589b4de2ee3d789abf20c5
Showing with 4 additions and 3 deletions.
  1. +4 −3 index.html
View
@@ -14,17 +14,18 @@
source: function (request, response) {
var userTerm = request.term;
$.ajax({
- url: "http://dev.finn.no/finn/job/autocomplete/frontpage/xhr",
+ url: "http://iad.finn.no:8080/finn/job/autocomplete/frontpage/jsonp",
data: {
rows: 5,
term: userTerm
},
+ jsonp: "jsonp",
dataType: "jsonp",
success: function (data) {
- response($.map(data, function (item) {
+ response($.map(data.result, function (item) {
var ad = item.hits !== 1 ? "annonser" : "annonse";
return {
- label: highLight(item.suggest, userTerm) + " <span class='pale fright'>(" + item.hits + " " + ad + ")</span>",
+ label: item.suggest + " <span class='pale fright'>(" + item.hits + " " + ad + ")</span>",
value: item.suggest,
hits: item.hits
};

0 comments on commit 2032a5f

Please sign in to comment.