Jquery autocomplete UI image option

I am using the JQuery Autocomplete UI with my rails app and it is working really well. I am sending the below JSON in my index.js.erb and both the value and title are working well. I found this example of using :img => "#(h{@object.img_url})" , but I have not been able to get it to work. [{"value":"Moby Dick","img":"http://ecx.images-amazon.com/images/I/517TZoo2JL._SL75_.jpg","label":"Moby Dick"}] Should this be working? or is this example not correct. If you have any suggestions on how to get the image to show up, I would really appreciate it. Below is the JS code I am using in my application.js $(document).ready(function(){ $(".auto_search_complete").autocomplete({ dataType: "json", source: '/books.js', minLength: 3 }) }) Thanks! James

以上就是Jquery autocomplete UI image option的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准