Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function() {
- var projects = [
- {
- value: "jquery",
- label: "jQuery",
- desc: "the write less, do more, JavaScript library",
- icon: "jquery_32x32.png"
- },
- {
- value: "jquery-ui",
- label: "jQuery UI",
- desc: "the official user interface library for jQuery",
- icon: "jqueryui_32x32.png"
- },
- {
- value: "sizzlejs",
- label: "Sizzle JS",
- desc: "a pure-JavaScript CSS selector engine",
- icon: "sizzlejs_32x32.png"
- }
- ];
- $( "#company_name" ).autocomplete({
- minLength: 0,
- source: $.getJSON("inc/auto_complete.json.php?callback=" + $( "#company_name" ).val() + Math.random(), function(data) {
- return data;
- }),
- focus: function( event, ui ) {
- $( "#company_name" ).val( ui.item.address );
- return false;
- },
- select: function( event, ui ) {
- $( "#project" ).val( ui.item.address );
- return false;
- }
- })
- .data( "autocomplete" )._renderItem = function( ul, item ) {
- return $( "<li></li>" )
- .data( "item.autocomplete", item )
- .append( "<a>" + item.address + "<br>" + item.address + "</a>" )
- .appendTo( ul );
- };
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement