Database LiveSearch |
[eluser]boltsabre[/eluser]
I haven't played with ajax and CI for a while, but I think if you just put your code from your getSearchResults.php file into your contoller (inside a function/method) and change your Code: $.post("getSearchResults.php",{partialSearch:value}, function(data){ to point to your controller/function instead of a file. That should work then!
[eluser]joe.afusco[/eluser]
When I point it to the controller/function, it throws the following error: POST http://localhost/crm/index.php/search/getSearchResults 500 Internal Server Error
[eluser]joe.afusco[/eluser]
Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
[eluser]sanir[/eluser]
Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Try this code.
[eluser]sanir[/eluser]
In you view file Quote:$("#search_results".html(data)); Change it to Code: $("#search_results").html(data));
[eluser]joe.afusco[/eluser]
New errors now from Firebug: missing ; before statement [Break On This Error] $("#search_results").html(data)); user_home (line 9, col 35) getSearchResults is not defined [Break On This Error] getSearchResults(this.value); Code is now: Code: function getSearchResults(value) {
[eluser]sanir[/eluser]
Code: $("#search_results").html(data); use this code.
[eluser]joe.afusco[/eluser]
With that adjustment, it gives the internal server error again. |
Welcome Guest, Not a member yet? Register Sign In |