Note that there are some explanatory texts on larger screens.

plurals
  1. POload page content using jquery in codeigniter error
    primarykey
    data
    text
    <p>I had a home page which have a few tables that refresh itself every few sec.</p> <p>Below is the code for the jquery in view file (inside_view.php)</p> <pre><code>&lt;script&gt; $(document).ready(function() { $("#encontainer").load("inside/home_en"); var refreshId = setInterval(function() { $("#encontainer").load('inside/home_en?randval='+ Math.random()); }, 9000); $.ajaxSetup({ cache: false }); }); &lt;/script&gt; &lt;div id="encontainer"&gt;&lt;/div&gt; </code></pre> <p>and here is the controller code (inside.php)</p> <pre><code>function index(){ // Write to $title $this-&gt;template-&gt;write('title', 'Update to date data'); $this-&gt;template-&gt;write_view('header', 'header_content', true); // Write to $content $this-&gt;template-&gt;write_view('content', 'inside_view', true); // Write to $sidebar $this-&gt;template-&gt;write_view('sidebar', 'user_side_menu'); // Load and display the template $this-&gt;template-&gt;load(); } function home_en(){ //look latest enquirer data $data['enresults'] = $this-&gt;customer_model-&gt;get_cp_list(5); $this-&gt;load-&gt;view('ajax_home_en',$data); } </code></pre> <p>here is the (ajax_home_en.php) code</p> <pre><code>&lt;link type="text/css" rel="stylesheet" href="http://bravonet.my/tombocrm/assets/css/table.css" /&gt; &lt;?php if($enresults-&gt;num_rows() == 0){ echo 'No data result, please insert one'; }else{ ?&gt; &lt;table width="100%"&gt; &lt;tr&gt; &lt;th&gt;CP code&lt;/th&gt; &lt;th&gt;Code&lt;/th&gt; &lt;th&gt;Name&lt;/th&gt; &lt;/tr&gt; &lt;?php foreach($enresults-&gt;result() as $row){ echo '&lt;tr class="tr'. alternator('1', '2'). '"&gt;'; ?&gt; &lt;td align="center"&gt;&lt;?php echo $row-&gt;cp_code?&gt;&lt;/td&gt; &lt;td align="center"&gt;&lt;?php echo $row-&gt;en_code?&gt;&lt;/td&gt; &lt;td align="center"&gt;&lt;?php echo $row-&gt;name?&gt;&lt;/td&gt; &lt;td align="center"&gt;&lt;?php echo anchor('customers/patient_update_view/'.$row-&gt;eid,'Edit');?&gt;&lt;/td&gt; &lt;td align="center"&gt;&lt;?php echo anchor('customers/cp_details_view/'.$row-&gt;cpid,'View');?&gt;&lt;/td&gt; &lt;/tr&gt; &lt;?php }?&gt; &lt;/table&gt; &lt;?php echo anchor('customers','View all data'); } ?&gt; </code></pre> <p>Everything is fine when i try to view this page with this url <a href="http://mysite.com/inside" rel="nofollow">http://mysite.com/inside</a></p> <p>but once i type this url <a href="http://mysite.com/inside/" rel="nofollow">http://mysite.com/inside/</a> or this <a href="http://mysite.com/inside/index" rel="nofollow">http://mysite.com/inside/index</a></p> <p>the </p> <pre><code>&lt;div id="encontainer"&gt;&lt;/div&gt; </code></pre> <p>show inside() view instead of home_en() view. n will have continuous page refreshing in the box (and makes my IE stop responding).</p> <p>I don't understand why adding a "/" or /index in the URL will cause such bug, is my javascript appear error? </p> <p>thx in advanced!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload