 <p>You are using CodeIgniter so why are you trying to load anything directly?</p> <p>Call the page as you would normally and add a controller method to do what is required in this situation. So:</p> <p>Assuming you have a controller called 'Search' create a method called something relevant lets say 'special_case' and call that with any parameters it requires like so</p> <pre><code>&lt;?php class Search extends Controller { function index() { // I assume this is what it is currently doing } function special_case() { // Make this do whatever is required in this case. } </code></pre> <p>Then call it from your Javascript using the standard CodeIgniter controller/method/param1/param2 ...... mechanism.</p>