gongpex Posted October 28, 2015 Share Posted October 28, 2015 Hello everyone, I had build ajax live search using JQuery to display data from my database using PHP, It can show the suggestion, but I want to display it using either of effects like slideDown or Fade, I had tried it but it's didn't work, this my code : $(document).ready(function() { $("#suggestion").on('keyup focus',function() { var selTable = $(this).val(); // selected name from search box $.ajax({ type: "GET", url: "<?php echo base_url();?>/index.php/search/product/", data : {'suggest':selTable}, dataType: "html", //expect html to be returned success: function(response){ $("#responsecontainer").html(response).slideDown("slow"); } }); });}); or $(document).ready(function() { $("#suggestion").on('keyup focus',function() { var selTable = $(this).val(); // selected name from search box $.ajax({ type: "GET", url: "<?php echo base_url();?>/index.php/search/product/", data : {'suggest':selTable}, dataType: "html", //expect html to be returned success: function(response){ $("#responsecontainer").html(response).fadeOut("slow"); } }); });}); Q : What mistake on my code? please help me Thanks Link to comment Share on other sites More sharing options...
gongpex Posted November 2, 2015 Author Share Posted November 2, 2015 Hello, Is there no solution for my problem? Link to comment Share on other sites More sharing options...
dauruk0512 Posted November 4, 2015 Share Posted November 4, 2015 post some simple example based on your code in codepen.io or jsfiddle it better to see what you need it ? Link to comment Share on other sites More sharing options...
thescientist Posted November 4, 2015 Share Posted November 4, 2015 It's hard to read your code, you should at least format it with proper indentation. You also don't mention what is happening. Are you checking for errors? What about the success of the request / response to the server? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now