views:

50

answers:

1

I'm using jQuery with CI for loading a view in this tag:

<div id="browseresults"> 
</div>

This script is placed after the </body> tag:

<script type="text/javascript">//<![CDATA[ 
    jQuery.noConflict();
    jQuery(document).ready(function() {
        //Load the results view
        jQuery('#browseresults').load("<?= base_url() . $this->uri->segment(1) . '/browse/results/' . $this->uri->segment(3) . '/ '.$this->uri->segment(3, 0);?>", function() {
  alert('Load was performed.');
         });
    }); 
//]]>
</script> 

Note, that any parameters are passed in the URL segments. In the controller I'm returning the content with this line:

$this->load->view('browse/browse_results', $main_data);

Using Firebug I can see that the status is 200 and the html content is generated as it should (also the callback is executed).

Although I can see the html page in Firebug, the content is not displayed in the browser at all. Note also that I have successfully used a similar procedure in another controller/view.

A: 

Got it!

For some reason this works:

http://www.example.com/segment1

but this doesn't:

http://www.example.com/segment1

That is, it works without a trailing slash. Although in both cases FireBug shows a 200 response, only in the first case it shows the content.

Zack