jquery - Live Search with PHP not working correctly on Chrome for Ubuntu -
i have webpage livesearch using php , mysql. works in chrome on mac , on pc, it's not running on chrome linux (ubuntu 16.04). when search keywords, gets results, when click on result doesn't anything, when supposed fill several inputs. guess chrome settings on linux, don't have clue. here's code:
$( document ).ready(function() { $(function(){ $(".search").keyup(function() { var searchid = $(this).val(); var datastring = 'search='+ searchid; if(searchid!='') { $.ajax({ type: "post", url: "search.php", data: datastring, cache: false, success: function(html) { $("#result").html(html).show(); } }); }return false; }); jquery("#result").live("click",function(e){ var $clicked = $(e.target); var $name = $clicked.find('.name').html(); var decoded = $("<div/>").html($name).text(); $('#searchid').val(decoded); }); jquery(document).live("click", function(e) { var $clicked = $(e.target); if (! $clicked.hasclass("search")){ jquery("#result").fadeout(); } }); $('#searchid').click(function(){ jquery("#result").fadein(); }); jquery("#result").live("click",function(e){ var $clicked = $(e.target); var $name = $clicked.find('.telefone').html(); var decoded = $("<div/>").html($name).text(); $('#telefoneid').val(decoded); }); jquery("#result").live("click",function(e){ var $clicked = $(e.target); var $name = $clicked.find('.id').html(); var decoded = $("<div/>").html($name).text(); $('#id').val(decoded); }); jquery("#result").live("click",function(e){ var $clicked = $(e.target); var $name = $clicked.find('.email').html(); var decoded = $("<div/>").html($name).text(); $('#email').val(decoded); }); jquery("#result").live("click",function(e){ var $clicked = $(e.target); var $name = $clicked.find('.nif').html(); var decoded = $("<div/>").html($name).text(); $('#nif').val(decoded); }); }); });
Comments
Post a Comment